How to select value
古いコメントを表示
clear Z=[-4:1:2];H=[0:1:4]; [xx,yy]=meshgrid(Z,H); zz=0.4166+0.0456.*yy-0.2343.*xx; if zz>=1 then zz=1 end if zz<=0 then zz=0 figure surf(xx,yy,zz) I want the value staying at (0,1), how to make this happen? and why this program doesn't work
採用された回答
その他の回答 (1 件)
TAMILAN
2024 年 7 月 3 日
0 投票
clear
Z=[-4:1:2];
H=[0:1:4];
[xx,yy]=meshgrid(Z,H);
zz=0.4166+0.0456.*yy-0.2343.*xx;
for k=1:numel(zz)
if zz(k)>1
zz(k)=1
elseif zz(k)<0
zz(k)=0
end
end
figure
surf(xx,yy,zz)
カテゴリ
ヘルプ センター および File Exchange で Instrument Connection and Communication についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!