calculating the slope of a curve on a plot

8 次查看(过去 30 天)
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 个评论
dpb
dpb 2016-5-8
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Line Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by