How to plot error bars on matlab between two points?

My code looks like this:
Mass=LabData(:,1);
DownForce=LabData(:,2);
UpForce=LabData(:,3);
plot(DownForce,Mass,'rd');
xlabel('Force (N)')
ylabel('Mass Difference (Kg)')
hold on
plot(UpForce,Mass,'bd');
hold off
I would like to put kind of horizontal type of error bars between the upforce and down force variables to show the difference between the two, is there a function capable of this?

回答 (1 件)

Boss35
Boss35 2016 年 1 月 15 日

0 投票

Husnain,
If I have understood correctly, it's better to plot the difference between the two vectors and plot the new vector along indices or whatever you have. e.g. you can do:
Error = UpForce-DownForce; %this gives you a new vector with the same size
barh(Error); %this will plot the bar graph horizontally

カテゴリ

ヘルプ センター および File ExchangeErrorbars についてさらに検索

質問済み:

HI2
2015 年 12 月 5 日

回答済み:

2016 年 1 月 15 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by