mkdir (your last name) cd (your last name) cp -R ../dat . cp ../simple.tex .
cp -R ~coult/dat . cp ~coult/simple.tex .This document contains information on graphics capabilities of
To start up matlab: In a shell window, type matlab.
To get help in matlab: Type help at the >> prompt. help (keyword) will display help for a keyword. To find all references to a word in the help files, type lookfor word, where word is the word you are looking for.
There is also on-line documentation for Matlab, found in various places. If you are in the newton lab, it is available locally. Otherwise, there is on-line documentation available here (fastest), here, and here, to name a few.
>> load dat/x1 >> plot(x1)
>> plot(x1(1:64))
>> load dat/y1 >> hold >> plot(y1,'red')
>> title('This is a nice plot.')
>> xlabel('x')
>> ylabel('y')
>> gtext('Text can be placed with the mouse!')
>> figure(2) >> plot(abs(x1-y1))
>> figure(1) >> hold >> load dat/x2 >> surf(x2) >> figure(2) >> waterfall(x2)
>> print -deps figure.epsNote that this command does not actually print the figure, it just outputs it to a file called figure.eps. To print the figure, type in a shell (outside of matlab, but don't do this now)
lpr figure.eps
>> print -dpng8 figure.png
To start up mathematica, type
mathematica &in a shell window.
To get help in Mathematica: Use the function browser, which you access by selecting the 'Open Function browser' menu item from the 'Help' menu. Or, if you know the name of a function and want to know more about it, type '?FunctionName'. FunctionName can be the full name of a mathematica function, or a string containing wildcards (*, ?), in which case mathematica will give you a list of function names which match that expression.
Examples:
sinplot=Plot[Sin[2*Pi*x],{x,0,1},PlotLabel->"This is a sine wave."]
sinplot3d=Plot3D[Sin[2*Pi*x]+Cos[8*Pi*y],{x,0,1},{y,0,1}]
ParametricPlot[{Sin[t],Cos[t]},{t,0,2*Pi},
AspectRatio->1,
PlotRange->{{-2,2},{-2,2}}]
x1=ReadList["dat/x1",Number];
ListPlot[x1,PlotJoined->True, AxesLabel->{"Indep. Variable","Dep. Variable"}]
x2=ReadList["dat/x2",Table[Number,{32}]];
ListPlot3D[x2]
cosplot=Plot[Cos[2*Pi*x,{x,0,1}];
Show[cosplot,sinplot];
\documentstyle[epsf]{article}
\begin{document}
This is a simple graphic in \LaTeX:
\epsfxsize=400pt
\centerline{\epsffile{figure.eps}}
\end{document}
The [epsf] tells LaTeX to use the epsf package, which
allows for importing of postscript-format files.
\epsfxsize=400pt scales the graphic's width to 400 points;
we could also specify the width in inches (in) or centimeters (cm).
\centerline{ } centers the stuff between curly braces.
\epsffile{figure.eps} is the command which loads the postscript
file figure.eps and uses it as a graphic in the LaTeX document at the point
where the command occurs.
To compile the latex source and view the result, do this in a shell:
latex simple.tex xdvi simple.dviNotice that the plot appears in color. If you print to a color printer, you'll get a nice hardcopy of your color plot! To print this, you need to change simple.dvi into a postscript file, which you do by running the following command in a shell:
dvips -o simple.ps simple.dviThe file simple.ps may now be printed by using the lpr command, i.e. (don't do this now):
lpr simple.ps
For Mathematica, there is: