Write MATLAB program for 3-D plot

Type 1

Code:

clc;
z=peaks(25);
figure
surf(z);
colormap(jet);


Output:





Type 2

Code:

clc;
z=peaks(25);
figure
colormap(jet);
subplot(2,2,1), mesh(z)
subplot(2,2,2), surf(z)
subplot(2,2,3),pcolor(z)
subplot(2,2,4), contour(z)


Output:




No comments

Powered by Blogger.