Matlab Tutorial
A Jump Start into Matlab
by
Klaus Moeltner
Department of Resource Economics
University of Nevada, Reno (UNR)
Mail Stop 204 / Reno, NV 89557-0105
phone: (775) 784-4803
email: moeltner@cabnr.unr.edu
web: http://www.ag.unr.edu/moeltner
August 15, 2007
Specifically designed as a 1/2 day "bare-bones" introduction to Matlab for
beginning Graduate Econometrics students
Comments & suggestions are always welcome!
Tutorial web site:
http://www.ag.unr.edu/moeltner/matlab_stuff.htm 1
Module I. Work Environment
Folder Structure
Create the following folder environment on your c:\ drive or any other path destination.
mlab
scripts functions worksp logs
For example, for this tutorial, you could first create a folder c:\mlab_tut\. Then, within this folder, create
the folder structure shown above.
Your main command scripts go into "scripts". Your sub-routines go into "functions". "Worksp" (short for
"workspace") contains your data and other saved elements. Output goes into "logs".
Matlab Windows and Matlab Path
When you open Matlab you will first see the command window. This is where you can enter interactive
commands.
File/new/m-file will open an editor window. This is where you write your programs (scripts and
functions). We'll come back to this in a moment. To close the editor window click on the red "x" in the
upper right hand corner. If you have multiple editor files open ...
Voir