I want to make a 3-D surface plot without contour lines of the function but I keep receiving a Matrix dimensions must agree error
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Marcus Evans
am 9 Apr. 2021
Kommentiert: Marcus Evans
am 9 Apr. 2021
% 3)Make a 3-D surface plot without contour lines of the function .
z = peaks(exp(2*(x-1).^2+(y+2).^2));
peaks(25);
colormap(pink) % change color map
shading interp
1 Kommentar
Saravanan Sengottuvel
am 9 Apr. 2021
Your code works fine for me. Does your input variables x and y dimensions are matching ?
Akzeptierte Antwort
Saravanan Sengottuvel
am 9 Apr. 2021
x = linspace(1,10,1000);
y = linspace(1,10,1000);
z = peaks(exp(2*(x-1).^2+(y+2).^2));
peaks(25);
colormap(pink) % change color map
shading interp
Try this code.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!