Chapter 1 : An Overview of Matlab Flashcards
clear the command window
clc
removes all variables from memory
clear
removes the variable var1 and var2 from memory
clear var1 var2
lists the variables currently in memory
who
lists the current variables and sizes and indicates if they have imaginary parts
whos
generates an array with regularly spaced elements
:
colon
separates elements in an array
,
comma
suppresses screen printing: also denotes a new row in an array
;
semi colon
continues a line
…
ellipsis
to simultaneously delete (kill) the end of the line
Ctrl k
infinity
Inf
indicates an undefined numerical result
NaN
show 4 decimal places
format short
show 16 digits
format long
five digits (four decimals) plus exponent
format short e
16 digits (15 decimals) plus exponent
format long e
two decimal digits
format bank
rational approximation (43/7)
format rat
suppresses some blank lines
format compact
resets to less compact display
format loose
e^x
exp(x)
ln(x)
log(x)
log base 10 x
log10(x)
arc sin, cos, tan
asin(x), acos(x), atan(x)
sin in degrees
sind(x)
puts grid lines on a plot
grid
enables placement of text with the mouse
gtext(‘text’)
generates a plot of the array y versus x on rectilinear axes
plot(x,y)
puts text in a title at the top of the plot
title(‘text’)
adds text to the horizontal axis
xlabel(‘text’)
adds text to the vertical axis
ylabel(‘text’)
designates a comment
%
displays the contents, but not the name, of the array A
disp(A)
displays the text string enclosed within single quotes
disp(‘text’)
displays the text in quotes, waits for user input from the keyboard, and stores the value in x
x = input(‘text’)