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!