Error using shadedErrorBar : length(x) must equal length(errBar)
2 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Annotations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!