Matlab Desktop( Cont MATLAB712.0(R2011a) x File Edit Debug Desktop window Help 日%部日0mtF贴1回 Launch pad Shortcuts a How to Add a what's New Current FolderIt口x| ommand window日 space 中口X bm·s·国№MA购回圆哈喝5 tack: Base E Select data to减 DName L >A=eye(4,4) Name△ Vaue 口 m3iregistr t registry outil +o win32 000 a deploytool bat Iworkzsngce s insttype ini p 出 cdata. xm a cdata.xsd 0 自 Current 压x Command History Hy= sin(x) irectory plot (x, y) Command xlabel(x= 0: 2\ a mexext bat Hylabel( Sine of History 回 mexsetup pm Window title( Plot of the Sine Function T mexutilspm lc m msvc modules installe clear all Details A=eye(4,4) a Start 6
6 Matlab Desktop (Cont.) Workspace Current Directory Command Window History Launch Pad
Matlab Desktop(cont Current Folder Access your files Command window Enter commands at the command line, indicated by the prompt Workspace view program variables double click on a variable to see it in the array editor Explore data that you create or import from files Command history View or rerun commands that you entered at the command line Launch pad access help, tools, demos and documentation
7 • Current Folder – Access your files • Command Window – Enter commands at the command line, indicated by the prompt (>>). • Workspace – view program variables – double click on a variable to see it in the Array Editor – Explore data that you create or import from files • Command History – View or rerun commands that you entered at the command line • Launch Pad – access help, tools, demos and documentation Matlab Desktop (cont.)
Command window The matlab environment is command oriented somewhat like UNIX. A prompt(>)appears on the screen and a matlab statement can be entered. When the <enter> key is pressed, the statement is executed, and another prompt appears If a statement is terminated with a semicolon(; ) no results will be displayed. Otherwise results will appear before the next prompt a b=a/2 b 2.5000
8 Command window • The MATLAB environment is command oriented somewhat like UNIX. A prompt (>>) appears on the screen and a MATLAB statement can be entered. When the <ENTER> key is pressed, the statement is executed, and another prompt appears. • If a statement is terminated with a semicolon ( ; ), no results will be displayed. Otherwise results will appear before the next prompt. » a=5; » b=a/2 b = 2.5000 »
MATLAB Math Operators Power Multiplication (matrix multiply) or . (array multiply) b or a*b Division a or ba b. a NOTE 56/8=8\56 Addition a b Subtraction a Assignment b(assign b to a) coSo Cosine value of a specific angle Sine value of a specific angle
9 MATLAB Math Operators Power ^ or .^ a^b or a.^b Multiplication * (matrix multiply) or .* (array multiply) a*b or a.*b Division / or ./ a/b or a./b or \ or .\ b\a or b.\a NOTE: 56/8 = 8\56 Addition + a + b Subtraction - a - b Assignment = a = b (assign b to a) * cos() Cosine value of a specific angle * sin() Sine value of a specific angle
As you work in MATLAB, you issue commands that ven EX1 create variables and call functions. For example, create a variable named a by typing this statement at the command Ine a=1 MATLAB adds variable a to the workspace and displays the result in the command window ry more b=2 c=a+b d=cos(a)
Ex1 • As you work in MATLAB, you issue commands that create variables and call functions. For example, create a variable named a by typing this statement at the command line: a = 1 • MATLAB adds variable a to the workspace and displays the result in the Command Window. • Try more: b = 2 c = a + b d = cos(a) 10