Error using shadedErrorBar : length(x) must equal length(errBar)
4 ビュー (過去 30 日間)
古いコメントを表示
So I've been trying to use shadedErrorBar for displaying the error bars for three lines of data that I have. I'm having a little difficulty understanding what the error message means (Error using shadedErrorBar : length(x) must equal length(errBar))
I'm attaching a part of my code below where I'm trying to plot my data:
I'm also attaching my code as well as the two xlsx files I'm using, if it helps clarify things. I'm also attaching the shadedErrorbar.m file since that contains the shadedErrorbar function.
MATLAB Code:
plot(averaged_time_alfax(1,:),averaged_alfax(1,:),'Color','[0 0.42 0.64]','LineWidth' ,2);
hold on
plot(averaged_time_dex(1,:),averaged_dex(1,:),'Color','[1 0.50 0.05]','LineWidth' ,2);
hold on
plot(averaged_time_prop(1,:),averaged_prop(1,:),'Color','[0.67 0.67 0.67]','LineWidth' ,2);
hold on % Shaded Error Bars
shadedErrorBar(averaged_time_alfax(1,:),averaged_alfax(1,:),{@mean,@std}, 'lineprops', {'color', [0 0.42 0.64]})
hold on
shadedErrorBar(averaged_time_dex(1,:),averaged_dex(1,:),{@mean,@std},'lineprops', {'color', [1 0.50 0.05]})
hold on
shadedErrorBar(averaged_time_prop(1,:),averaged_prop(1,:),{@mean,@std}, 'lineprops', {'color', [0.67 0.67 0.67]})
If it helps, I'm also gonna provide the sizes of each of these variables:
averaged_time_alfax and averaged_alfax= 19x1779 (I only want to plot the first row of each of these though, as shown in my code)
averaged_time_dex and averaged_dex= 28x1779
averaged_time_propofol and averaged_propofol= 21x1779
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Bar Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!