Environmental Engineering Reference
In-Depth Information
use.
ginput
stores the position in the current coordinate system in the variables
x0
and
y0
. The input parameter
1
in the command tells that a single point is read. Note
that the command waits for user input, i.e. the execution of the M-file does not
continue before the user has not finished the task.
The following
plot
command places a black '
+
' at the location on the display
where the mouse click occurred (see Fig.
17.2
).
inputdlg
is the MATLAB
®
command for an input dialog, which here asks the user to input the coordinates of
the marked location in the real coordinate system. The dialog box is shown in
Fig.
17.2
, with the values '900' and '1,000', which have been entered by the user.
The input parameters of the command are easy to relate: 'horizontal' and 'vertical'
are text strings associated with the input fields; 'Field position' is the header text.
Both input fields are located in a single line, and default values for the two variables
are '0'.
After the input dialog is closed, the coordinate values, chosen by the user, are
stored in the
coords
variable, containing two strings. As for further processing the
values (not the strings) are required, the strings have to be transformed into
numbers. The two
str2double
commands transform the strings to double precision
values. After the reference point 1 is read, the following
delete
command deletes
Fig. 17.2
Illustration of work with the geo-referencing example