Shared Flashcard Set

Details

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

Additional Computer Science Flashcards

 


 

Cards

Term
linspace
Definition
linspace(first #,last #,# of #'s total)
Term
./ and .\
Definition
x= 3 3 3
y= 1 1 1

x./y= 3 3 3
x.\y= .3 .3 .3 (rounded)
Term
a=constant
b=vector

5a+b=?
Definition
Matlab error

This is different from 5*a+b
Term
x=[a,b,c]
y=[g;e;f] <--notice column vector

x*y=?
Definition
ag+be+cf
Term
edit
Definition
opens editor window
Term
function
Definition
function (something) = anotherthing(a,b)
something=a*b

anotherthing(2,4)=8
Term
sum(A)

A=MxN matrix
Definition
adds all columns first

sum(sum(a)) will add all numbers up
Term
plot

X=vector
Y=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 ones
ones(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=10

x= will be 10
Term
fplot
Definition
fplot(@func3(x),[0,10])

0 to 10 is the interval
Term
quadl vs. trapz
Definition
used to approximate integrals

quadl 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 poins
Y=solution points
0 to 100 is the interval
and 0 and .005 are some initial points pertaining to the function
Term
fzero
Definition
fzero finds roots nearest to a guess, x
IF AND ONLY IF THE FUNCTION IS CONTINUOUS

fzero('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 1
identity matrix
Term
diag(1:2,0)

diag(1:2,1)
Definition
1 0
0 2

0 1 0
0 0 2
0 0 0
Term
5:-3:2

colon 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^2

roots([1 2 0 0])
Supporting users have an ad free experience!