Exam 2: Review Flashcards
Determine the best fit cubic function through ordered pairs (y,z); display the constant term of the function
[p, s] = polyfit(y,z,3)
disp(p(4))
Create a Cartesian plot of ordered pairs (x,y) in the upper right quadrant of figure number 66.
figure(66)
subplot(2,2,2)
plot(x,y)
Place a message on the plot at coordinates (5,10) that displays the value of a numeric array, CLmax
text(5,10, num2str(CLmax))
loglog(g,d,’–gd’)
plot of d as a function of g, both axis logarithmically, scaled dashed green line with green diamond data markers
data = data(find(data~=0))
removes zeros from the data array
z = uiputfile(‘*.bmp’,’Save data’)
z is the user selected location to save .bmp image. A command window will appear and allows the user to select where they wish to save the .bmp file
set(gca,’YDir’, ‘Reverse’)
gca = get current axis
reverse direction of the y axis for the current set of axes
command that would plot data in teh straightest alignment and include a dotted red line with res squares.
semilogy(x,y,’:rs’)
List the three basic construsts of “structured programming” common to all programming languages
- sequential
- conditional
- iterative
When do you use a for loop?
Use a for loop when you know how many cycles the loop will need to complete, but not the final result.
When do you use a while loop?
when you know the final condition but not how many cycles it will take.
What is the difference between curvefit and spline?
Spine goes through every data point,
Curvefit does not
List four basic mathematical functions we used for modeling data
- exponential
- Logarithmic
- Linear
- Power
What is the forward difference?
(y_i+1 - y_i)/(x_i+1 - x_i)
What is the backward difference?
(y_i - y_i-1)/(x_i - x_i-1)