f
f
o
o
r
r
m
m
a
a
t
t
l
l
o
o
n
n
g
g
e
e
Floating-point format with 15 digits.
f
f
o
o
r
r
m
m
a
a
t
t
l
l
o
o
n
n
g
g
g
g
Best of fixed or floating-point format with 15 digits.
f
f
o
o
r
r
m
m
a
a
t
t
b
b
a
a
n
n
k
k
Fixed format for dollars and cents.
Suppressing Output
If you simply type a statement and press [Enter], Matlab automatically
displays the results on screen. However, if you end the line with a semicolon
“;” Matlab performs the computation but does not display any output [2].
This is particularly useful when you generate large matrices. For example,
“A =
m
m
a
a
g
g
i
i
c
c(100);”
although Matlab creates a 100-by-100 matrix saved in the workspace, the
result is not displayed on the command window. Moreover, when a
command ends with “;”, is allowed to enter additional commands before
pressing the [Enter] key. For instance,
“A =
m
m
a
a
g
g
i
i
c
c(100); B=A;”
will perform two commands the one after the other. In here, after creating
the 100-by-100 magic square that is stored in the
A
A (matrix) variable, matrix
B
B is created to hold the same values as with
A
A. Additionally, note that if two
or more statements are separated with commas, Matlab will display the
results in the screen in the order that these statements were entered.
Entering Long Statements
If a statement does not fit on one line, use an ellipsis (three periods), “...”,
followed by [Enter] to indicate that the statement continues on the next line.
For example,
“s = 1 -1/2 + 1/3 -1/4 + 1/5 - 1/6 + 1/7
.
.
.
.
.
.
- 1/8 + 1/9 - 1/10 + 1/11 - 1/12”
to get:
Komentáře k této Příručce