You are on page 1of 1

rem: normal remainder int amount.

(x,y=divisor)
mod: rem but if 1st negative, then abs value both. If one negative, its yhigh-x
zeros(N) n by n matrix but zeros(n,m) is n by m matrix.
single(N): 8 sig fig precision.
sind: sin degrees
round: normal round
fix: round toward zero, works on matrix
ceil: toward plus infinity
floor: toward neg infinity
rand: 0 to 1
randi: randi(MAX,N) or randi(MAX,M,N) m by n matrix.
linspace: linspace(a,b,n) other is start stride end
size: size in rows and columns
length: largest of size
numel: number of elements
reshape(A,m,n): returns m by n matrix columnwise from A.
fliplr: flip left to right
rotate90: 90 counterclockwise
diff: returns matrix of differences between consecutive elements.
Min: sum max prod all treat each column as vector and return n element vector from m-n matrix
All: 1 if all are non zero, any is counterpart.
Inv: inv multipled to b to find x. same as \.
Input: var=input(text,type) type is double by default, if string must specify.
Fprintf: prints normally. Uses the percent thing and then comma and then variable,
Sprintf: prints as string only. If in percent, n.d n is too big, leading blanks there. Incl decimal.
Switch: switch of n where n is the expression and case are the different ns.
Continue: ignores rest of loop and goes to next iteration.
If: use or | and &. Double for scalar(will be for most) and single for logical return.
Diag(x,n): makes vector on nth diagonal. if x is matrix, makes column from nth diagonal.
Textscan:textscan(fid,fomat,n) n is number of lines read, by default all. Makes cell
Fscanf:fscanf(fid, format,size) size is size of output matrix. Only numbers outputted.
Nargin(func): returns number of inputs in function. If nargin is inside function itself, returns
nargin of said function.
Nargout: opposite.
Varargin: input variable that allows function to accept any number of inputs. Puts input into
1byN cell array
Varargout: opposite
Importdata(filename,delimiter,nheaderlines): returns data cell array and text cell array;

You might also like