Graphics Reference
In-Depth Information
Figure 1-13.
When an input (user input ) is proposed to MATLAB in the Command Window that does not cite a variable to
collect the result, MATLAB returns the response using the expression ans = as shown at the beginning of Figure 1-13 .
If at the start of our input to MATLAB, we define a variable to contain the results, we can then use that variable as the
argument for subsequent entries. That is the case with variable v in Figure 1-13 , which is subsequently used as input
in an exponential function call.
To run an input entry, simply press Enter once you have finished. If at any point in the input we put a semicolon,
the program runs calculations to that point and keeps them in memory ( Workspace ), but it does not display the result
on the screen (see the first input in Figure 1-13 ). After you have hit Enter, MATLAB will respond and when it is done,
the input prompt again appears “ >> ” to indicate that you can enter a new command, function, etc.
Like the C programming language, MATLAB is sensitive to the difference between uppercase and lowercase
letters; for example, Sin (x) is different from sin (x) . The names of all MATLAB built-in functions begin with lowercase.
There should be no spaces in the names of functions or in symbols of more than one letter. In other cases, spaces
are ignored. They can be used to make input more readable. To save time you can provide input for multiple entries
separated by commas on the same line of a command,, and pressing Enter at the end of the last entry will run each of
the MATLAB responses separately (Figure 1-14 ). If you use a semicolon at the end of one of the entries of the line, its
corresponding output is not displayed.
Search WWH ::




Custom Search