PAGE
PAGE 3
四川师范大学MATLAB语言实验报告1
系 级 班 年 月 日
实验名称:Intro, Expressions, Commands
姓名 学号 指导教师 成绩
Objective
The objective of this lab is to familiarize you with the MATLAB program development environment and to develop your first programs in this environment.
Using MATLAB
Starting MATLAB
Logon to your computer and start MATLAB by double-clicking on the icon on the desktop or by using the Start Programs menu. MATLAB Desktop window will appear on the screen.
The desktop consists of several sub-windows. The most important ones are:
Command Window (on the right side of the Desktop) is used to do calculations, enter variables and run built-in and your own functions.
Workspace (on the upper left side) consists of the set of variables (arrays) created during the current MATLAB session and stored in memory.
Command History (on the lower left side) logs commands entered in the Command Window. You can use this window to view previously run statements, and copy and execute selected statements.
You can switch between the Launch Pad window and the Workspace window using the menu tabs under the sub-window on the upper left side. Similarly, you can switch between the Command History and Current Directory windows using the menu tabs under the sub-window on the lower left side.
Executing Commands
You can type MATLAB commands at the command prompt “>>” on the Command Window.
For example, you can type the formula cos(π/6)2 sin(3π/8) as
>>(cos(pi/6) ^ 2) * (sin(3 * pi/8))
Try this command. After you finish typing, press enter. The command will be interpreted and the result will be displayed on the Command Window.
Try the following by observing how the Workspace window changes:
>> a = 2; (Make note of the usage of “;”)
>> b = 3;
>> c = a ^ 4 ? b ? 5 + pi ^3
You can see the variables a, b and c with their types and sizes on the Workspace window, and can see the command