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.

 采纳的回答

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 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by