SUNY Geneseo Department of Mathematics
Friday, October 2
Math 230 01
Fall 2015
Prof. Doug Baldwin
subplot
function>> % x^2 from -3 to 3
>> xs = linspace( -3, 3, 200 );
>> ys = xs .^ 2;
>> plot( xs, ys )
>> ylabel( 'x^2' )
% Put y = 2x on same axes
>> hold on
>> plot( [-3, 3], [2 * -3, 2*3 ] )
>> axis( [ -3, 3, 0, 9 ] )
>> hold off
>> clf % Erase contents of figure window
>> % x(t) = sin(2t), y(t) = cos(3t)
>> xs = sin( 2 * linspace( 0, 2*pi, 20 ) ); % Jagged plot, not enough points
>> ys = cos( 3 * linspace( 0, 2*pi, 20 ) );
>> plot( xs, ys )
>> ys = cos( 3 * linspace( 0, 2*pi, 200 ) ); % Smooth plot
>> xs = sin( 2 * linspace( 0, 2*pi, 200 ) );
>> plot( xs, ys )