Approximate a log curve as linear to predict a value

조회 수: 5 (최근 30일)
Brian Robinson
Brian Robinson 2020년 5월 29일
편집: Matt J 2020년 5월 29일
Hello there,
I have the following code:
clf
P = [0.01; 0.1; 1; 3; 5; 10; 25; 50; 75; 90; 95; 97; 99; 99.9];
phi_1 = [5.28; 4.10; 2.82; 2.15; 1.82; 1.33; 0.59; -0.12; -0.72; -1.18; -1.42; -1.57; -1.81; -2.14];
Cs_1 = Cv_Q
K_p_1 = Cv_Q.*phi_1 + ones(length(phi_1),1);
Q_p_1 = meanQ*K_p_1;
semilogx(P, Q_p_1)
Which produces this curve
My plan is to approximate a line from P = 0.01 and P = 0.1 and then plot this line to predict the Q_p value at P = 0.01.
What is the best way to go about this?
Thanks,
Brian
  댓글 수: 4
Adam Danz
Adam Danz 2020년 5월 29일
What is this?
meanQ*K_p_1
Brian Robinson
Brian Robinson 2020년 5월 29일
Hi Adam,
meanQ = 2775
K_p =
4.76406175741670
3.92285098587282
3.01035116589301
2.53271454137233
2.29746068153379
1.94814434419777
1.42060538577194
0.914453141876893
0.486718851261359
0.158789228456116
-0.0123044877900973
-0.119238060443981
-0.290331776690195
-0.525585636528738

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2020년 5월 29일
편집: Matt J 2020년 5월 29일
idx=(P<=0.1);
c=polyfit(log10(P(idx)),Q_p_1(idx),1);
semilogx(P, Q_p_1, P,polyval(c,log10(P)),'x-' )

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by