Effacer les filtres
Effacer les filtres

calculating the slope of a curve on a plot

2 vues (au cours des 30 derniers jours)
Joseph
Joseph le 7 Mai 2016
Commenté : dpb le 8 Mai 2016
I'm trying to calculate the slope of only one curve on a plot with many curves, then i want to calculate the percent error of that curve vs another curve. i have attached a picture. i want to calculate the slope of the red curve,'C_lift' and find the percent error between the red curve and the black curve,'C_lift,exp'. the code is below
% Basic plot of lift coefficient vs. angle of attack
figure(2)
hold on
plot(alpha_deg,clift,'r')
xlabel('Alpha (deg)')
figure(2)
hold on
plot(alpha_deg,cdrag,'g')
figure(2)
hold on
plot(alpha_deg,cmqc,'b')
figure(2)
hold on
plot(alpha_deg,xcp,'m')
figure(2)
hold on
plot(a_exp,cl_exp,'k')
title('NACA 0012 - C_{drag},C_{lift},C_{m,1/4},X_{CP},C_{lift,exp} vs Alpha')
ylabel('C_{lift},C_{drag},C_{m,1/4},X_{cp},C_{lift,exp}')
legend('C_{lift}','C_{drag}','C_{m/1/4}','X_{cp}','C_{lift,exp}')
  1 commentaire
dpb
dpb le 8 Mai 2016
For what definition of "slope" and "error"? An average over the full set of data or pointwise, or what??? It appears the experimental data isn't terribly linear while the reference closer, but not perfect.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by