Programming and Graphics

(Kiana) #1

348 Introduction to C++ Programming and Graphics


clear Clear variables and functions from memory
demo Run demos
exit Terminate aMatlabsession
help On-line documentation
load Retrieve variables from a specified directory
save Save workspace variables to a specified directory
saveas Save figure or model using a specified format
size Reveal the size of matrix
who List current variables
quit Terminate aMatlabsession

Table F.3.1General utilityMatlabcommands.


The commandclearis especially important, as it resets all variables to the
“uninitialized” status, and thereby prevents the use of improper values defined
or produced in a previous calculation. A detailed explanation of this command
can be obtained by typinghelp clear.


F.4 Elementaryexamples.........................


In the following examples, we demonstrate the interactive usage ofMatlabwith
simple sessions. A line beginning with two “greater than” signs (>>) denotes
theMatlabcommand line where we enter a definition or issue a statement.
Unless stated otherwise, a line that does not begin with>>isMatlabout-
put. Recall that the commandclearclears the memory from previous data to
prevent misappropriation.



  • Numerical value assignment and addition:


>>a=1
a=
1
>>b=2
b=
2
>>c=a+b
c=
3
Free download pdf