This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
gibson:teaching:fall-2014:math445:lecture16-diary [2014/11/18 07:24] gibson |
gibson:teaching:fall-2014:math445:lecture16-diary [2014/11/18 07:25] gibson [surf, surfc] |
||
---|---|---|---|
Line 89: | Line 89: | ||
The previous plots were all looking straight down at the (x,y) plane, with the value of z = f(x,y) encoded as a color. The ''surf'' function will plot z = f(x,y) in 3D, as a surface of height z over the (x,y) plane. | The previous plots were all looking straight down at the (x,y) plane, with the value of z = f(x,y) encoded as a color. The ''surf'' function will plot z = f(x,y) in 3D, as a surface of height z over the (x,y) plane. | ||
+ | <code matlab> | ||
surf(X,Y,Z) % draw z=f(x,y) as a surface over x,y | surf(X,Y,Z) % draw z=f(x,y) as a surface over x,y | ||
xlabel('x'); ylabel('y'); zlabel('z') | xlabel('x'); ylabel('y'); zlabel('z') | ||
axis equal; axis tight | axis equal; axis tight | ||
+ | </code> | ||
It's also possible to draw more complicated surfaces (surfaces that are not simple graphs of the form | It's also possible to draw more complicated surfaces (surfaces that are not simple graphs of the form |