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!