How to choose data with three conditions to plot contour

I want to choose all the values from -50:1:50 with three conditons.
1, greater than zero(x>0),
2,smaller than -25 (x<-25)
3,replace the values between 0 to-25 with zero. x(x>=-25)=0;
But, i am unable to plot the contour from below code.
x = -50:1:50;
x = max(x,0) & min(x,-25)% logicals are wrong
% please suggest
Error using griddata
Invalid input arguments

 採用された回答

Serhii Tetora
Serhii Tetora 2020 年 7 月 31 日

1 投票

x(x<0 & x>-25) = 0;

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Contour Plots についてさらに検索

質問済み:

MS
2020 年 7 月 31 日

コメント済み:

MS
2020 年 7 月 31 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by