Need help converting equation into matlab code.

Dear all,
I need help to convert this equation into matlab code.
This is the code i'm currently working with and my attempt to convert it,
c1 = 0.518;
c2 = 116;
c3 = 0.4;
c4 = 5;
c5 = 21;
c6 = 0.0069;
lambda = 0:0.01:16;
beta = 2;
u = 1./(1./(lambda+0.08*beta)-0.035./((beta.^3)+1));
cp = c1.*(c2./u)-(c3.*beta-c4).*(exp(-c5./u))+(c6.*lambda);
cp doesn't return the correct values.
Thank you.

 채택된 답변

Torsten
Torsten 2022년 11월 21일
편집: Torsten 2022년 11월 21일

1 개 추천

cp = c1*(c2./u - c3*beta - c4).*exp(-c5./u) + c6*lambda;
instead of
cp = c1.*(c2./u)-(c3.*beta-c4).*(exp(-c5./u))+(c6.*lambda);

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

태그

질문:

2022년 11월 21일

편집:

2022년 11월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by