barweb error message in negative value
显示 更早的评论
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
回答(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]);
类别
在 帮助中心 和 File Exchange 中查找有关 Simulink 3D Animation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!