How to stop a plot when values get to negative.
12 ビュー (過去 30 日間)
古いコメントを表示
I have a 10 by 10 matrix say z = rand(10,10), x = linspace(0,1,10) and y = linspace(0,1,10). I am plotting a surface plot: surf(x,t,z) and would like it to stop plotting when z < 0.5. I have used the while loop but but it runs forever. Any alternatives or recommendations? Thank you.
0 件のコメント
採用された回答
OCDER
2018 年 5 月 9 日
Set the z-axis limit to stop drawing below or above certain ranges
z = rand(10,10);
x = linspace(0,1,10);
y = linspace(0,1,10);
surf(x,y,z)
Ax = gca;
Ax.ZLim(1) = 0.5;
0 件のコメント
その他の回答 (1 件)
Fangjun Jiang
2018 年 5 月 9 日
one way to do it, not sure if it is right for your use case though,
z(z<0.5)=nan;
surf(x,y,z)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Line Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!