next up previous contents
Next: init.m Line-by-Line Up: Infant MATLAB Previous: Infant MATLAB   Contents

Some MATLAB commands

pwd - This stands for ``print working directory ''. You can use this to check that you are in c:$\backslash$M2214$\backslash$Matlab$\backslash$.

axis([a,b,c,d]) - This specifies the portion of the tx-plane that will be visible in the graphics window: a<t<b, c<x<d. If no graphics window is already displayed, it will create one. The t-axis is horizontal, the x-axis is vertical. Generally you will not work directly with the axis command. Instead you will enter the desired values as the vector-valued variable initax in init.m. For example, initax=[-2,2,-4,4]; and axis(initax) sets the graphics window to -2<t<2, -4<x<4.

plot(t,x) - If the vectors t and x have been created and have the same size, plot(t,x) will plot them in 2D.

\begin{eqnarray*}
\mbox{Example} && \mbox{\tt t=0:0.1:5}; \\ && \mbox{\tt x=t.$\wedge$2};
\\ && \mbox{\tt plot(t,x)}
\end{eqnarray*}



This plots the function $x \,=\, t^2$ for $0 \leq t \leq 5$.
print - You will need to print copies of various graphics displays. Methods may differ slightly depending on the machine/system you are using. First click on the desired graphics display window to be sure it (not the command window) is the active window. (If there is more than one graphics display window, be sure to choose the correct one.) Generally MATLAB is installed so that you only need to enter the command print, and your plot will be printed to your default printer. You can also ``print" your graphics to a PostScript file for later printing. Use the command print <filename.ps> where ``filename" is one of your choice.
clear - This clears all variables and assignments for the current session of MATLAB. Sometimes this is necessary to just start things over. Individual variables can also be cleared. Type help clear at the command prompt for more information.


next up previous contents
Next: init.m Line-by-Line Up: Infant MATLAB Previous: Infant MATLAB   Contents
Michael Renardy
2000-05-12