Problem obtaining a symmetrical surface using surf
显示 更早的评论
%% Dear matlab user, probably my question is simple but...
%% I would like to plot z=f(x,y) using "surf" with the code below.
%%% In my datas, maximum value (50) of z is at x=y=0 but not in the surface plot.
%%% how can I have the center of the red square at x=y=0 and not at x=y=0.5
%%% thank you.
%%%% denis
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure (1)
clf
x=[ -3 -2 -1 0 1 2 3 ];
y=[ -2 -1 0 1 2];
z=[
0 0 0 0 0 0 0
0 0 30 30 30 0 0
0 0 30 50 30 0 0
0 0 30 30 30 0 0
0 0 0 0 0 0 0];
surf (x,y,z)
view([0 90])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 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!