Instructions A. Opening and Closing Matlab

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

INSTRUCTIONS

A. Opening and closing Matlab.


1. To open Matlab, double click the desktop icon or search and click in the programs.
2. To exit Matlab, either click on Exit Matlab from the File menu or typing quit or exit in the Command Prompt
Window. DO NOT click on the close box on the upper right corner.

B. Accessing the Help window.


1. To get in the Help browser, either click on the help button (?) in the desktop toolbar, or select the Help menu in
any tool.
2. Once in the Help browser, select the Contents tab in the Help Navigator pane on the left.
3. To get to the desktop section, expand MATLAB > Getting Started > Development Environment.

C. Using the Command window.


1. Type the following in the Command window, then click Enter:
>> 2+3 <Enter>
>> 3-2 <Enter>
>> 2*3 <Enter>
>> 1/2 <Enter>
>> 2^3 <Enter>
>> 2\1 <Enter>
2. Also try the following commands:
>> 2 .*3 <Enter>
>> 1 ./ 2 <Enter>
>> 2 .^3 <Enter>
3. Matlab has a useful editing feature called smart recall. Just type the first few characters of the command you
want to recall, say 2*, then press the up-arrow key. This would recall the most recent command starting with 2*.
4. Try the following commands:
>> 0/1 <Enter>
>> 1/0 <Enter>
>> 0/0 <Enter>
Matlab will try to warn you in case you didn’t realize you were dividing by zero but will still give you the answer Inf.
In the last command, another special value is obtained NaN, which means Not-a-Number.

5. To assign variables, perform the following commands:


>> x = 2 <Enter>
>> y = 3; z = 4; <Enter>
>> w = x + y - z <Enter>

You might also like