next up previous contents
Next: Contour plots Up: 2.1.3 Other 2-D plots Previous: Scatter Plots   Contents Function plots

If you just want to plot a function, say $y=e^x$, and you are too lazy to define two arrays of $x$ and $y$ values, there's a shorter way.
% Lazy plotting 
close all; clear all;
Here are some more.
% More lazy plotting
close all; clear all;
figure(1) % Make multiple plot windows, start with #1 
ezplot('exp(x)',[0 1]) % The second argument defines the x range
figure(2) % Open a second plot window
ezplot('x^2+y^2=1') % Notice the "implicit" definition of y=f(x)
figure(3) % Open yet another figure window
F='1+3*cos(2*theta)'; % Define a function to be plotted
ezplot(F) % Notice how nicely the plot and x-axis are labeled
Some other ``ez'' versions of MATLAB's plotting commands are ezpolar, ezplot3d, ezcontour, and ezsurf.

Gus Hart 2005-01-28