MATLAB Flashcards
(43 cards)
Loops
cause specific code to repeat
ans
stores the result of an expression
roots(x)
roots of a polynomial
isinf(a)
returns 1 for infinite
ischar(a)
returns 1 for character
clf
clears figure window
subplot(m,n,p)
displays several plots in the same figure window
plot3(x,y,z)
plots function of two independent variables x and y
hold on
freezes the current plot for subsequent graphics command
branches
selects specific sections of code to execute
isnan(a)
returns 1 for not a number
any(a)
returns 1 if any elements do not equal 0
ones(n,m)
creates an n x m array of ones
ones(n)
creates an n x n array of ones
zeros(n,m)
creates an n x m array of zeros
zeros(n)
creates an n x n array of zeros
length(arr)
returns the length of a vector or longest dimension
load
loads file into workspace
!
embeds operating system commands directly into program
plot(x,y)
plots x and y versus each other
semilogx(x,y)
plots x on a logarithmic axis
semilogy(x,y)
plots y on a logarithmic axis
bar(x,y)
creates a bar chart
polar(theta,r)
polar plot