Jump to content

User:Eml4500.f08.ramrod.olivero

From Wikipedia, the free encyclopedia

References

[edit]

Many MATLAB features were not included in the tutorial but they are listed below and organized by their subject area. There are more functions beyond the ones that are included below but these can be located by using the help command. Here are some easy reference charts that will help during the use of MATLAB.

Managing Commands and Functions
help help facility
what lists M-files on disk
type list named M-file
lookfor key word search through the help entries
which locate functions and files
demo run demonstrations
path control MATLAB's search path
cedit set parameter for command line editing and recall
version display MATLAB version you are running
whats new display toolbox README files
info info about MATLAB and the Math Works
why receive flippant answer
Managing Variables and the Workspace
who lists current variables
whos lists current variables, long form
save save workspace variables to disk
load retrieve variables from disk
clear clear varaibles and functions from memory
pack consolidate workspace memory
size size of vextor
length length of vector
disp display martix or text
Working With Files and the Operating System
cd change current working directory
pwd show current working directory
dir, ls directory listing
delete delete file
getnv get environment variable
! execute operating system command
unix execute operating system command; return result
diary save text of MATLAB session
Controlling the Command Window
clc clear command window
home send cursor home-to top of screen
format set output format
echo echo commands inside script commands
more control paged output in command window


Sarting and Quitting from MATLAB
quit terminate MATLAB
startup M-file executed when MATLAB is started
matlabrc master startup M-file


Matrix Operators Array Operators
+ addition + addition
- subtraction - subtraction
* multiplication .* multiplication
^ power .^ power
/ right division ./ right division
\ left division .\ left division
' conjugate transpose
.' transpose
kron Kronecker tensor product


Relational and Logical Operators
< less than & and
<= less than or equal " or
> greater than ~ not
>= greater than or equal == equal
zor exlusive or ~ not equal


Special Characters
= assignment statement
[] used to form vectors and matrices; enclose multiple function output variables
() arithmetic expression precedence; enclose function input variables
. decimal point
.. parent directory
... continue statement to next line
, separate subscripts, function arguments, statements
; end rows, suppress printing
% comments
: subscripting, vector generation
! execute operating system command


Special Variables and Constraints
ans answer when expression not assigned
eps floating point precision
realmax largest floating point number
pi pi
i,j imaginary unit
inf infinity
NaN Not-a-Number
flops floating point operation count
nargin number of funciont input arguments
nargout number of function output arguments
computer computer type


Time and Date
date current date
clock wall clock
etime elapsed time function
tic, toc stopwatch timer functions
cputime elapsed CPU time


Special Matricies
zeros matrix of zeros
ones matrix of ones
eye identity
diag diagonal
toeplitz Toeplitz
magic magic square
compan companion
linspace linearly spaced vectors
logspace lgarithmically spaced vectors
meshgrid array for 3-D plots
rand uniformly distributed random numbers
randn Normally distributed random numbers
hilb Hilbert
invhilb inverse Hilbert (exact)
vander Vandermonde
pascal Pascal
hadamard Hadamard
hankel Hankel
rosser symmetric eigenvalue test matrix
wilkinson Wilkinson's eigenvalue test matrix
gallery two small test matrices


Matrix Manipulation
diag create or extract diagonals
rot90 rotate matrix 90 degrees
fliplr flip matrix left-to-right
flipud flip matrix up-to-down
reshape change size
tril lower trangular part
triu upper triangular part
.' transpose
: convert matrix to single column; A(:)


Logival Functions
exist chich if variables or functions exist
any true if any element of vector is true
all true if all elements of vector are true
find find indices of none-zero elements
isnan true for NaNs
isinf true for finite elements
finite true for finite elements
isieee true for IEEE floating piont arithmetic
isempty true for empty matrix
issparse true for sparse matrix
isstr true for text string
strcmp compare string variables


Control Flow
if conditionally execute statements
else used with if
elseif used with if
end terminate if,for, while
for repeat statements for a specific number of times
while repeat statements while condition is true
break terminate execution of for or while loops
return return to invoking function
error display message and abort function


Programming
input prompt for userinput
keyboard invoke keyboard as if it were a script file
menu generate menu of choices for user input
pause wait for user response
function define fucntion
eval execute string with MATLAB expression
feval evaluate funciont specified by string
global define gloabal variables
nargchk validate number of input arguments


Text and Strings
string about character stings in MATLAB
abs convert sting to numeric values
balnks a sting of blanks
eval evaluate sting with MATLAB expression
num2str convert nubmer to string
int2str convert integer to sting
str2num convert sting to number
isstr true for sting variables
strcmp compare sting variables
upper convert sting to uppercase
lower convert sting to lowercase
hex2num' convert hex string to floating point number
hex2dec convert hex sting to decimal integer
dec2hex convert decimal integer to hex string


Debuggin
dbstop set breakpoin
dbclear remove breakpoint
dbcont remove execution
dbdown change loacal workspace context
dbstack list who called whom
dbstatus list all breakpoints
dbstep execute one or more lines
dbtype list M-file with line numbers
dbup change local workspace context
dbdown new opposit of dbup
dbquit quit dbug mode


Sound Processing Functions
saxis sound axis scalling
sound convert vector to sound
auread Read Sun audio file
auwrite Write Sun audio file
lin2mu linear to mu-law conversion
mu2lin mu-law to linear conversion


Elementary Math Functions
abs absolute value or complex magnitude
angle phase angle
sqrt square root
real real part
'imag imaginary part
conj complex conjugate
gcd greatest common divisor
lcm least common multiple
round round to the nearest integer
fix round toward zero
floor round toward negative infinity
ceil round toward inifinty
sign signum function
rem remainder
exp exponention base e
log natural logarithm
log10 log base 10


Special Functions
bessel bessel funciont
beta beta function
gamma gamma function
rat rational approximatnion
erf error function
erfinv inverse error function
ellipke complete elliptic intergral
ellipj Jacobian elliptic integral
expint expontential integral
log2' new dissect floating point numbers
pow2 scale floating point numbers


Matrix Decompostions and Factorizations
inv inverse
lu factors from Gaussian elimination
rref reduced row echelon form
chol Cholesky factorization
qr orthogonal-triangular decompostion
nnls nonnegative least squares
lscov least squares in presence of known covariance
null null space
orth orthogonalization
eig eigenvalues and eigenvectors
hess Hessenberg form
schur Schur decompostition
cdf2rdf complex diagonal form to real block diagonal form
balance diagonal scaling for eigenvalue accuracy
qz generalized eigenvalues
plyeig polynomial eigenvalue solver
svd singular value decompostition
pinv psuedoinverse