Biomedical Engineering Reference
In-Depth Information
between lower and uppercase in executing commands (so “a” is different from “A”), and it
does not use italic or bold characters as defined in Section A.1.
MATLAB evaluates scalars as well as matrices. For example, if we enter
>>
A
¼
10/5
MATLAB returns with
A
¼ 2
To enter a matrix, we start with the matrix name, then an equal sign followed by a left
bracket, the elements of the array, and then a right bracket. Each element in a row is
entered, beginning with the first row, separated by a blank space or a comma. To move
from one row to the next row, a semicolon or a CR is entered. For example, matrix A is
entered in MATLAB by writing
>>
A
¼
[596;323;591]
MATLAB returns with
A
¼ 596
323
591
Matrix elements can also be entered as a function, such as
>>
A
¼
[
5/2, sqrt(4), 3 * (6
4)]
MATLAB returns with
A
¼
2
:
5000
2
:
0000
6
:
0000
Note that a “;” at the end of any line suppresses printing of that line. A line can also be
extended by typing “
” and a CR at the end of any line so that the next line is just a con-
tinuation of the previous line.
For example,
...
>>
C
¼
[1
...
23
456
789]
C
¼ 123
456
789
Here the first row is written on two lines with “
...
” at the end of the first line and a CR
rather than “;” separating the rows.
Search WWH ::




Custom Search