Filter löschen
Filter löschen

how to code equation

3 Ansichten (letzte 30 Tage)
Cesar Cardenas
Cesar Cardenas am 28 Feb. 2023
Bearbeitet: Voss am 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 Kommentare
Les Beckham
Les Beckham am 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 am 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);

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Voss
Voss am 28 Feb. 2023
Bearbeitet: Voss am 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 ./

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by