Error Bars

9 ビュー (過去 30 日間)
Judah S
Judah S 2011 年 6 月 27 日
hi,
I have some errors on x and y axes and I am able to plot error on the y axis by using errorbar. I am not able to plot error on x axis together on the same graph. Here is the code.
close all;
clear all;
clc;
r0 = 2.2;
vout = [0.391710782 0.349193537 0.299451595 0.268145156];
x_conc = [605.5 697 807 949];
rs = (3.6./vout-2)/r0;
error_vout = [0.014846491 0.009265438 0.020145148 0.018445414];
error_conc = [16.5 2 6 6]; % error in concentration
error_rs = 3.6*error_vout./vout.^2;
figure;
errorbar(x_conc,rs,error_rs,'.b','marker','h','markersize',12,'markeredgecolor','b','markerfacecolor','r');
xlim([0.9*min(x_conc) 1.1*max(x_conc)]);
x_conc is my x axis and rs is y. error_rs is the error on y axis which I plotted. In the graph it is shown vertically since rs is on y axis. Now how can I plot error_conc? I don't know to plot this error horizontally since x_conc is on x axis.
I will be thankful if someone helps.
Best,

採用された回答

Daniel Shub
Daniel Shub 2011 年 6 月 27 日
There are a number of functions on the FEX that should allow you to do this. I haven't used any of them, but
looks promising.
If that doesn't work for you maybe this one will:

その他の回答 (1 件)

Judah S
Judah S 2011 年 6 月 27 日
Thanks Daniel but I am not sure I can use it in this case.
  3 件のコメント
Judah S
Judah S 2011 年 6 月 27 日
http://www.mathworks.com/matlabcentral/fileexchange/5444-xyerrorbar
this worked.
Thanks.
Judah S
Judah S 2011 年 6 月 27 日
First one could probably be useful if I had gone for each point and defined the error separately. It's almost same if I run a command to draw line on both directions of the points.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by