2 Development Environment
2 Development Environment
Quitting MATLAB
• To end your MATLAB
session, select Exit
MATLAB from the File
menu in the desktop
OR
OR
Script M-files
• Standard ASCII text files
• Contain a series of MATLAB expressions
(Typed as you would at the command line)
>> fibo
enter the number of elements to be generated 8
1 1 2 3 5 8 13 21
MATLAB Development Environment Introduction - 9
>> a = 10;
>> b = 20; Clear variable_name clears the specified
variable from the workspace
>> c = a + b ;
>> who
clear clears all the variables from the
Your variables are
workspace
abc
>> clear c;
>> who
Your variables are
ab
MATLAB Development Environment Introduction - 11
>> who
Your variables are:
area radius s
MATLAB Development Environment Introduction - 12
>> pwd
ans =
C:\Program Files\MATLAB\R2007a
>> dir
M-files in the current directory
. .. adplin.m wave.asv wave.m
>> what
M-files in the current directory
C:\Program Files\MATLAB\R2007a
adplin wave
MATLAB Development Environment Introduction - 14
>> size( a )
ans =
2 3
>> length(a)
ans =
3
MATLAB Development Environment Introduction - 15
Array Editor
For editing 2-D
numeric arrays
double-click
>> openvar A
MATLAB Development Environment Introduction - 16
Online Help
• The help command >> help
• The help window >> helpwin
>> help cd
CD Change current working directory.
CD directory-spec sets the current directory to the one specified.
CD .. moves to the directory above the current one.
CD, by itself, prints out the current directory.
MATLAB Editor/Debugger
MATLAB Desktop
MATLAB Current Directory
MATLAB Help Window
MATLAB Command History
MATLAB Workspace