Hi all, can anyone please help to create code for the condition bellow
1 次查看(过去 30 天)
显示 更早的评论
x = 10:20:200
y = 0.1:0.08:1
[X,Y] = meshgrid(x,y)
I = eye(13,10)
Z = 8.1.*0.7.*X when, X <= 60
else
Z =8.1.*42.*I ,X>60
mesh(X,Y,Z)
figure;
surf(X,Y,Z)
2 个评论
ARHUM AHMAD
2023-4-25
I hope its helpful;
x = 10:20:200
y = 0.1:0.08:1
[X,Y] = meshgrid(x,y)
I = eye(13,10)
Z = [];
for i = 1:12
for j = 1:10
if X(i,j) <= 60
Z(i,j) = 8.1.*0.7.*X(i,j);
else
Z(i,j) =8.1.*42.*I(i,j);
end
end
end
mesh(X,Y,Z)
figure;
surf(X,Y,Z)
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!