calculating the slope of a curve on a plot
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
dpb
am 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.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Line Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!