how to code equation

1 次查看(过去 30 天)
Cesar Cardenas
Cesar Cardenas 2023-2-28
编辑: Voss 2023-2-28
Nu = (0.032.*(Pr).^(1/3)).*((rho.*Uinf.*x/mu).^(1/2)).*(1 -(x0/x).^(3/4).^(-1/3);
Hello, is this code right? not sure, any help will be appreciated thanks.
  2 个评论
Les Beckham
Les Beckham 2023-2-28
It looks like it might be right, but that depends on the size and class of all of the variables; are they scalars, vectors, 2d arrays, something else, integers, complex, double. The details matter.
Did you try to run the code? If so, what happened? If you got an error message, cut and paste all of the text of the error message into an edit of your question, or a new comment.
Since we can't see your Matlab workspace, we can't answer your question until you share more information.
Cesar Cardenas
Cesar Cardenas 2023-2-28
I have not run the code, but I see this on the workspace "parse error at EOL"
Nu = (0.032.*(Pr).^(1/3)).*((rho.*Uinf.*x/mu).^(1/2)).*(1 -(x0/x).^(3/4).^(-1/3);

请先登录,再进行评论。

采纳的回答

Voss
Voss 2023-2-28
编辑:Voss 2023-2-28
Nu = (0.032.*(Pr).^(1/3)).*((rho.*Uinf.*x/mu).^(1/2)).*(1 -(x0/x).^(3/4).^(-1/3);
% ^^ you need another closing parenthesis here
% ^ ^ ^ ^ ^ ^ extraneous parentheses (that don't affect the operation)
% ^^^^^ should be 0.332
After correcting those things:
Nu = 0.332.*Pr.^(1/3).*(rho.*Uinf.*x/mu).^(1/2).*(1 -(x0/x).^(3/4)).^(-1/3);
And some of those / may have to be ./, depending on whether x and/or mu are scalars. Doesn't hurt to just use ./

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by