Problem obtaining a symmetrical surface using surf
Show older comments
%% 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])
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!