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!