EE341 EXAMPLE 1: INTERACTIVE PLOTTING WITH MATLAB

Matlab Commands Typed:
EDUğ dir

.              deisl1.isu     ghostscript    matlabrc.m.bak relnotes.txt   
..             extern         help           notebook       toolbox        
bin            ghostscr       matlabrc.m     readme.txt     

EDUğ cd ../../temp
EDUğ diary example1.txt
EDUğ t=0:0.1:6;
EDUğ f=cos(2*t);
EDUğ plot(t,f);
EDUğ xlabel('t (seconds)');
EDUğ ylabel('f(t)');
EDUğ title('Plot of f(t) = cos(2t)');
EDUğ grid;
EDUğ diary off
EDUğ 
Diary File example1.txt Created in /temp Directory:
t=0:0.1:6;
f=cos(2*t);
plot(t,f);
xlabel('t (seconds)');
ylabel('f(t)');
title('Plot of f(t) = cos(2t)');
grid;
diary off
Matlab Plot Generated:

Note that the plot can be printed by typing print at the >> prompt or
selecting File->Print from the figure window.