**This is an old revision of the document!** ----
====== Math 445 Lab 10: 2D and 3D graphics ====== Important matlab commands: **linspace, meshgrid, pcolor, surf, contour, surfc, contourf, quiver, mesh, load, subplot, pcolor, shading**. ===== Part A: pcolor, meshgrid, shading, subplot ===== 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 ''pcolor,'' ''axis equal,'' and ''axis tight'' to generate the figure on the left. 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 the figure on the right {{:gibson:teaching:fall-2012:math445:a.png?nolink&500|}} {{:gibson:teaching:fall-2012:math445:lab10-fig2.png?nolink&500|}} 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 plot: Attribution: based on Prof. Mark Lyon's "Advanced Graphics" lab for Math 445, which was adapted from an [[http://yapso.sourceforge.net/demo/demo.html | Octave demo]].