1MatLab- stand for
MATrix LABoratory
2MatLab basic data element is
a matrix (array)
3It is a powerful language for technical writing
It can be used for math computations, modeling and simulations, data analysis and processing, visualization and graphics, and algorithm development
MatLab
44 WINDOWS
1. Command Window
2. Figure Window
3. Editor Window
4. Help Window
5it is the MATLAB’s main window, and opens when MATLAB is started.
Command Window
6convenient to have as the only visible window
Command Window
7Main window, enter variables, runs programs
Command Window
8Contains output from graphic command
Figure Window
9Creates and debugs script and function files
Editor Window
10Provides help information
Help Window
11Provides access to tools, demos, and documentation
Launch Pad Window
12Logs Commands entered in the Command Window
Command History Window
13Provides Information about the variables that are used.
Workspaces Window
14Shows the files in the current directory
Current Directory Window
15open automatically when graphics commands are executed, and contains graphs created by these commands
figure windows
16is used for writing and editing programs. This window is opened from the Desktop menu in the Command Window. It is also used to create function files
editor window
17contains help information. This window can be opened from the HELP menu in the toolbar of any MatLab window.
Help Window
18 is interactive and can be used to obtain information on any feature of MatLab.
Help Window
19if a _______ is typed at the end of a command the output of the command is not displayed
semicolon (;)
20- Typing ____ is useful when the result is obvious or known, or when output is very large
semi colon
21when the symbol ____ is typed in the beginning of a line, the line is designated as a comment
%
22when the symbol % is typed in the beginning of a line, the line is designated as a
comment.
23are frequently used in programs to add descriptions, or to explain the program
comment.
24type ___ and press enter clears the Command Window.
clc
31ARITHMETIC OPERATION
1. Addition
2. Subtraction
3. Multiplication
4. Right Division
5. Left division
6. Exponentiation
32ORDER OF PRECEDENCE
1. Parentheses. For nested parentheses, the innermost are executed first
2. Exponentiation
3. Multiplication ,division (equal precedence)
4. Addition and Subtraction
33Fixed-point with 4 decimal digits for: 0.001 < number < 1000 Otherwise display format short e
>> 290/7 ans= 41.4286
format short
34Fixed-point with 14 decimal digits for: 0.001 < number < 100 Otherwise display format long e
>> 290/7 ans= 41.42857142857143
format long
35Scientific notation with 4 decimal digits.
>> 290/7 ans= 4.1429e+001
format short e
36Scientific notation with 15 decimal digits.
>> 290/7 ans= 4.142857142857143e+001
format long e
37Best of 5-digit fixed or floating point
>> 290/7 ans= 41.429
format short g
38Best of 15-digit fixed or floating point
>> 290/7 ans= 41.4285714285714
format long g
39Two decimal digits.
>> 290/7 ans= 41.43
format bank
40Eliminates empty lines to allow more lines with information displayed on the screen.
format compact
41Adds empty lines (opposite of compact)
format loose
42Display Format commands:
1. format short
2. format long
3. format short e
4. format long e
5. format short g
6. format long g
7. format bank
8. format compact
9. format loose
43is a name made of a letter or a combination of several letters(and digits) that is assigned a numerical value.
Scalar variables
44of the assignment operator can include only one variable name.
the left hand side
45can be number, or a computable expression that can include numbers and/or variables that were previously assigned numerical values.
The right hand side
46RULES ABOUT VARIABLE NAMES
1. Can be up to 63 characters long
2. Can contain letters, digits, and the underscore character.
3. Must begin with a letter.
4. MATLAB is case sensitive; it distinguishes between uppercase and lowercase letters: For example: AA, Aa, aa, and aA are the names of the four different variables.
5. Avoid using the names of built-in function for a variable
47a variable that has the value of the last expression that was not assigned to a specific variable
ans
49The smallest difference between two numbers. Equals to 2^ (-52), which is approximately 2.2204e-016.
eps
51Defined as √-1, which is: 0+1.0000i
i
53Stands for a Not-a-Number. Used when MATLAB cannot dtermine a valid numeric value. For example 0/0
NaN
54NaN stands for
Not-a-Number
55Removes all variables from the memory
clear
56Removes only variables x, y and z from the memory
clear x y z
57Displays a list of the variables currently in the memory
who
58Displays a list of the variables currently in the memory and their size together with information about their bytes and class
whos