Environmental Engineering Reference
In-Depth Information
Fig. 20.6 The example GUI, first step
statements are executed within the coordinate system, named xaxes , which is part
of the handles structure. Later we introduce another coordinate system, making the
necessity to specify the axes more obvious.
The x vector is a discretization of the entire model length. Within the following
for loop, for each time instant of the t vector, the temporary 'help' parameter h is
calculated. h is used in the lengthy analytical formula that follows within the plot
command. Note that the concentration values are not stored in a big matrix, unlike
in the M-files of Chaps. 4-6. Here they are lost after plotting is executed, because
they are not needed further.
The last formal parameter in the plot command ( y(mod(i,7) + 1)) ) effects
that the line color changes from one profile to the next, according to the characters
given above in the y string. The set command specifies an increased line width
(default is 0.5). The hold on statement is necessary in order to obtain all profiles in
the same figure. The final graphics command, grid on , plots the grid. The resulting
outlook of the GUI is depicted in Fig. 20.6 .
20.2 The Transport GUI
Here we extend the M-file from the previous part. In the MATLAB
guide we add
three graphical elements, all of which are shown in Fig. 20.7 . A second 'Axes'
element is introduced. In order to make both graphics fit on the same panel figure,
the size of the coordinate systems is reduced. Using the property inspector, the new
®
Search WWH ::




Custom Search