SUNY Geneseo Department of Mathematics
Wednesday, February 17
Math 230 02
Spring 2016
Prof. Doug Baldwin
xlabel
, ylabel
plot
- central plotting functionplot( xvector, yvector )
plotyy
>> % Plot y = x^2
>> % Algorithm: make vector of xs
>> % make vector of ys
>> % plot xs, ys
>> xs = linspace( 1, 10 );
>> ys = xs .^ 2;
>> plot( xs, ys );
>> axis square
>> axis equal
>> % Plot y = log x and y = x on same axes
>> clf
>> xs = linspace( 1, 1000, 1000 );
>> ys = log( xs );
>> hold off
>> plot( xs, ys );
>> hold on
>> plot( xs, xs, 'r' )
>> % Jagged graph
>> xs = linspace( 1, 10, 3 );
>> ys = xs .^ 2;
>> clf
>> plot( xs, ys )