This is an old revision of the document!
Important matlab commands: linspace, meshgrid, pcolor, surf, contour, surfc, contourf, quiver, mesh, load, subplot, pcolor, shading.
Skim the Matlab documentation for
linspace, meshgrid, and
pcolor. Create a 2D mesh from −π to π with 30 points in both the x and y directions. Then for each position in the mesh let z = cos(x) sin(y). Use
axis equal, and
axis tight to generate this figure:
But don't you hate those ugly black lines? You can get rid of them with the
shading command. Use
subplot and the
shading command to generate this figure:
Create a 2D mesh from −π to π with 20 points in both the
y directions, let
z = cos(x) sin(y) pointwise, and then recreate this figure using the