MATLAB: Can anyone help me answer this question? Pleaseeeeeee

#langrangehomework

Best Answer

Here's a start:
Doverd = [6,3,2,1.5,1.2,1.1,1.07,1.05,1.03,1.01]
c = [.88, .89 .91, .94, .97, .95, .98, .98, .98, .92]
a = [33,31,29,26,22,24,21,20,18,17]/100
Kt = c .* (Doverd/2 - 0.5) .^ (-a)
% Fit c as a function of D/d with a 5th order polynomial
[coefficientsC, S, mu] = polyfit(Doverd, c, 5)
xFit = linspace(min(Doverd), max(Doverd), 300);
fittedC5 = polyval(coefficientsC, xFit, S, mu);
plot(Doverd, c, 'bs-');
grid on;
hold on;
plot(xFit, fittedC5, 'r-');
xlabel('D/d', 'FontSize', 20);
ylabel('c', 'FontSize', 20);
legend('Actual', '5th order Fit');
% Fit a as a function of D/d with a 5th order polynomial
coefficientsA = polyfit(Doverd, a, 5)
Related Question