# how to code equation

1 view (last 30 days)
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.
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.
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);

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 ./