CEN 100 Lecture Notes - Lecture 3: Subplot, Matlab, Linear Map
Document Summary
For 3-d graphics, the most commonly used commands are: surf(x,y,z) uses z for the color data and surface height. X and y are vectors or matrices defining the x and y components of a surface. = n and length(y) = m, where [m,n] = size(z). In this case, the vertices of the surface faces are (x(j), y(i), z(i,j)) triples. To create x and y matrices for arbitrary domains, use themeshgrid function. surf(x,y,z,c) uses c to define color. Matlab performs a linear transformation on this data to obtain colors from the current colormap. The surf function is used to create a 3-d surface plot. The surfl function creates a surface plot with colormap-based lighting. For smoother color transitions, use a colormap with linear intensity variation such as pink. surfl(z) colormap(pink) shading interp. The contour function is used to create a plot with contour lines of constant value. contour(z,16) colormap default.