Lectures 6 - 11 Flashcards

1
Q

What is the generic code for an unconditional loop?

A

for loopvarname=m:s:n
statements
end

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is another name for unconditional loops?

A

For loops

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is another name for conditional loops?

A

while loops

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the generic code for while loops

A

while (logical expressions)
statements
end

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the criteria for while loops

A

logical expression must have a defined variable prior to the while statement
it must be updated with each iteration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What creates a 3D plot?

A

surf(x,y,z)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

2D logarithmic x linear y

A

semilogx(x,y)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

2D logarithmic y linear x

A

semilogy(x,y)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

2D logarithmic x and y

A

loglog(x,y)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

2D polar plot of theta and r

A

polar(th,r)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

axis square

A

makes the plot area square

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

axis equal

A

sets the plot area with proportional axes (equal unit lengths)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

axis normal

A

returns axes to default settings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

grid on/grid off

A

turns on and of griddlines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

hold on/hold off

A

freezes contents of plot area for adding other data series (lets you plot multiple data series on same figure)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Describe these line types

solid, dashed, dashed dot, dotted

A

-.
:

17
Q

describe these color types

black blue red green cyan magenta yellow white

A
k black
b blue
r red
g green
c cyan
m magenta
y yellow
w white
18
Q

Describe these symbol types

dot asterisk x cross circle upright triangle inverted triangle square diamond 5 point star

A
. dot
* asterisk
X x
\+ cross
o circle
^ upright triangle
V inverted trianlge
s square
d diamond
p 5-point star
19
Q

Puts a text string on the current plot with coordinates (x,y)

A

text(x,y,’my text’)

20
Q

Puts a text string on the plot where the user clocks the arrow

A

gtext(‘my text’)

21
Q

What are the basic types of mathematical models?

A

linear
power law
exponential
logarithmic

22
Q

Matlab command that fits a polynomial of order n to data stored in vectors x,y. What does it also perform?

A

[p,s]=polyfit(x,y,n)

performs a least-squares method to obtain polynomial curvfits

23
Q

What characterizes a perfect fit?

A

J = 0 (dimensional) and R^2 = 1 (dimensionless)