how to code equation

3 views (last 30 days)
Cesar Cardenas
Cesar Cardenas on 28 Feb 2023
Edited: Voss on 28 Feb 2023
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 Comments
Les Beckham
Les Beckham on 28 Feb 2023
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 on 28 Feb 2023
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);

Sign in to comment.

Accepted Answer

Voss
Voss on 28 Feb 2023
Edited: Voss on 28 Feb 2023
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 ./

More Answers (0)

Community Treasure Hunt

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

Start Hunting!