barweb error message in negative value
Show older comments
ampl = squeeze(dtopstore(:,:,3,chan));
order = [1:6]
ampl = ampl(order,:);
figure;
barweb([nanmean(ampl(1:2,:)') NaN nanmean(ampl(3:4,:)') NaN nanmean(ampl(5:6,:)')],[nanstd(ampl(1:2,:)')/sqrt(10) NaN nanstd(ampl(3:4,:)')/sqrt(10) NaN nanstd(ampl(5:6,:)')/sqrt(10)]);
The error message is
Bad property value found. Object Name : axes Property Name : 'YLim' Values must be increasing and non-NaN.
Error in ylim (line 44) set(ax,'ylim',val);
Error in barweb (line 161) ylim([ymax*1.1 0 ]);
Error in script (line 116) barweb([nanmean(ampl(1:2,:)') NaN nanmean(ampl(3:4,:)') NaN nanmean(ampl(5:6,:)')],[nanstd(ampl(1:2,:)')/sqrt(10) NaN nanstd(ampl(3:4,:)')/sqrt(10) NaN nanstd(ampl(5:6,:)')/sqrt(10)]);
not sure how to deal with it
Andrew
Answers (1)
Sorry for the late reply, but I just ran into this problem myself. When you input negative values for your bars, the value ymax is 0, so setting ylim([0 0]) results in your error.
I added two lines
line#115
ymin = 0
line#158, inside the %Plot errors loop
ymin = min([ymin; barvalues(:,i)-errors(:,i)]);
and replaced ylim, line#165
ylim([ymin*1.1 ymax*1.1]);
Categories
Find more on Simulink 3D Animation 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!