Environmental Engineering Reference
In-Depth Information
Table 1.3 Number representation in MATLAB
®
Characteristics
Double
Single
Storage [bits]
64
32
Storage [byte]
8
4
Mantissa storage incl. sign [bits]
53
24
Exponent storage incl. sign [bits]
11
8
Max. significant decimals, mantissa
16
8
Max. significant decimals, exponent
3
2
Max. exponent of binaries
1,023
127
Min. exponent of binaries
1,022
126
1.7977 10 308
3.4028 10 38
Maximum float (absolute value)
2.2251 10 308
1.1755 10 38
Minimum float (absolute value)
2.2204 10 16
1.1921 10 7
Machine accuracy (of 1)
Due to the limited number of digits in the exponent there are minimum and
maximum positive and negative numbers, that are not
0. From the 11
bits for the exponent one is needed for the sign, leaving the range to represent
2 10
1
or
functions realmax and
realmin return the maximum and minimum values that you can represent with the
double data type. The range for double is
1,024 numbers, i.e. from 0 to 1,023. The MATLAB
®
1.79769e+308 to
2.22507e
308 and
2.22507e
308 to 1.79769e+308. For further characteristics of floating point num-
bers see the following Table 1.3 .
The command window is good for an introduction into MATLAB
. Finally, the
work with M-files replaces extensive operating in the command window (see
Chapter 2.5). Nevertheless, for certain tasks, the command window will remain
the most direct and simple way to compute with MATLAB
®
.
Aside from the command window, the user may select numerous other views of
the desktop. The different options are depicted in Fig. 1.3 . Very important is the
workspace view, where all variables of the current session are visible and directly
available. The workspace of the just started session, shown in Fig. 1.2 , is depicted
on the left side of the figure. The workspace appears only if the view is selected in
the 'Desktop' submenu, as shown in Fig. 1.3 . Using who or whos in the command
window is an alternative way to access the workspace (and its contents).
Here, a is the only variable in the workspace which is of 'double' type and of
®
1
1 size (a single variable and not a 'real' matrix). A double-click on the block-
panel symbol, left of the variable name in the workspace, delivers an array editor, in
which the contents of variables can be viewed directly. In the simple example case
the result is given in Fig. 1.4 . With the array editor it is not only possible to view
variables, but also to change them. The user can easily explore the use of the editor
on her/his own.
To mention is the 'command history' view, in which all commands are listed. An
example with one command only is depicted in Fig. 1.5 . The user can initiate the
repeated command, mostly with some workspace variables changed, by double-
click in the command history window. This is a shortcut to the alternative method to
Search WWH ::




Custom Search