Question: WRITE THE CODE & THE OUTPUTS 4. Interpolation and surface plots. Write a script called randomSurface.m to do the following To make a random surface,

WRITE THE CODE & THE OUTPUTS
4. Interpolation and surface plots. Write a script called randomSurface.m to do the following To make a random surface, make ZO a 5x5 matrix of random values on the range [0,1] (rand) Make an X0 and YO using meshgrid and the vector 1:5 (use the same vector for both inputs into meshgrid). Now, XO, YO, and ZO define 25 points on a surface. We are going to interpolate intermediate values to make the surface seem smooth. Make X1 and Y1 using meshgrid and the vector 1:.1:5 (again use the same vector for both inputs into meshgrid). a. b. c. d. Make z1 by interpolating X0, YO, and ZO at the positions in X1 and Y1 using cubic interpolation (interp2, specify cubic as the interpolation method) e. Plot a surface plot of Z1. Set the colormap to hsv and the shading property to interp (surf, colormap, shading) Hold on to the axes and plot the 15-line contour on the same axes (contour). Add a colorbar (colorbar) Set the color axis to be from 0 to 1 (caxis). The final figure should look something like this (if the figure isn't copy/pasting into your document appropriately, try changing the figure copy options to use a bitmap) f. g. h. 0.9 w. 0.8 0.8 0.6 0.4 0.2 0 02 4 3 4 4 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
