image thumbnail

MATLAB Plot Gallery - Function Surface Plot

by

 

24 Feb 2012 (Updated )

Create a surface plot from a function

Function_Surface_Plot

This is an example of how to create a surface plot from a function in MATLAB®.

Read about the ezsurf function in the MATLAB documentation.

For more examples, go to MATLAB Plot Gallery

% Create the plot using the functions
% x = sin(pi*u)*sin(pi*u)*cos(v) ; y = sin(pi*u)*sin(pi*u)*sin(v) ; z = u
% with - 1 < u < 1 and 0 < v < 2*pi
figure
ezsurf('sin(pi*u)*sin(pi*u)*cos(v)', ...
          'sin(pi*u)*sin(pi*u)*sin(v)', ...
          'u', [-1 1 0 2*pi])

% Change the view angle for the plot
view(135,15)

Contact us