calculating the slope of a curve on a plot

조회 수: 5 (최근 30일)
Joseph
Joseph 2016년 5월 7일
댓글: dpb 2016년 5월 8일
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에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by