Shared Flashcard Set

Details

cs101 uuic exam 1
university of illinois computer science 101 exam 1
34
Computer Science
02/19/2013

Term
 linspace
Definition
 linspace(first #,last #,# of #'s total)
Term
 ./ and .\
Definition
 x= 3 3 3 y= 1 1 1x./y= 3 3 3x.\y= .3 .3 .3 (rounded)
Term
 a=constantb=vector5a+b=?
Definition
 Matlab errorThis is different from 5*a+b
Term
 x=[a,b,c]y=[g;e;f] <--notice column vectorx*y=?
Definition
 ag+be+cf
Term
 edit
Definition
 opens editor window
Term
 function
Definition
 function (something) = anotherthing(a,b)something=a*banotherthing(2,4)=8
Term
 sum(A)A=MxN matrix
Definition
Term
 plotX=vectorY=Vector
Definition
 plot(X,Y)'g'=green'gx' marks points with green x's and takes away connecting lines
Term
 length
Definition
 x=[1 2 76]length(x)=3
Term
 < > == >= <= ~=
Definition
 relational operators, these will give you true false results 1=true 0=false
Term
 repmat
Definition
 repmat(number/numbers,M,N)MxN matrix
Term
 ones
Definition
 ones(M,N)MxN matrix of onesones(N)NxN
Term
 '
Definition
 A=[1 2 3] %1x3 A'=[1;2;3] %3x1
Term
 cumsum
Definition
 [image]
Term
 polyval
Definition
 polyval([1,2,3],x)=x^2+2x+3
Term
 designating certain parts of matrices
Definition
 [image]
Term
 global
Definition
 global X x=10x= will be 10
Term
 fplot
Definition
 fplot(@func3(x),[0,10])0 to 10 is the interval
Term
Definition
 used to approximate integralsquadl is more accurate
Term
 trapz
Definition
 trapz(t,a)t and a are vectors (number strings)integral of a with respect to t
Term
 ode45
Definition
 [T,Y] = ode45(@func,[0,100],[0;.005])T=Column vector time poinsY=solution points0 to 100 is the intervaland 0 and .005 are some initial points pertaining to the function
Term
 fzero
Definition
 fzero finds roots nearest to a guess, xIF AND ONLY IF THE FUNCTION IS CONTINUOUSfzero('sin',x)x=guess'sin' just an example of a function
Term
 surf(x,y,z)
Definition
 3D graph of Z surface height over x and y
Term
 meshgrid
Definition
 meshgrid(x,y)creates ordered pairs of two string of numbers x and y
Term
 a=b(2,:)
Definition
 a is the vector starting the 2nd row of matrix be and going to the end.
Term
 eye
Definition
 eye(2)= 1 0 0 1identity matrix
Term
 diag(1:2,0)diag(1:2,1)
Definition
 1 00 20 1 00 0 20 0 0
Term
 5:-3:2colon operator
Definition
 [5 2]starting#: count by: until #
Term
 v= [1 2 3]v>=2 ?v(v>=2) ?
Definition
 v>=2 = [0 1 1]v(v>=2) = [2 3]
Term
 exp
Definition
 exp(2)=e^2
Term
 x=[1 2 3 4 5]x(end:-2:end-4)this is the same as x(end:-2:1)
Definition
 [5 3 1]
Term
 rand
Definition
 rand(m,n)MxN matrix of random number up to 1
Term
 diff
Definition
 x=[1 4 9]diff(x)=[3 5]
Term
 roots
Definition
 find roots of x^3+2x^2roots([1 2 0 0])
Supporting users have an ad free experience!