equation code not getting right answer
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello, I'm trying to code this expression, this is my attempt but I'm not getting the same answer/value, not sure what I'm doing wrong. Any help/guidance will be appreciated.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1633516/image.png)
% Given values
%AInfinity = 1;
%AInlet = 6.5;
MInlet = 0.5;
MInfinity = 2;
gamma = 1.4;
a = (1 + (gamma-1/2)* MInfinity^2)
b = (1 + (gamma-1/2)* MInlet^2)
b1 = (MInlet/MInfinity)
r = b1*(a/b)^(gamma + 1/(2*gamma -1))
0 commentaires
Réponse acceptée
VBBV
le 2 Mar 2024
Modifié(e) : VBBV
le 2 Mar 2024
% Given values
%AInfinity = 1;
%AInlet = 6.5;
MInlet = 0.5;
MInfinity = 2;
gamma = 1.4;
a = (1 + ((gamma-1)/2)* MInfinity^2) % for numerator
b = (1 + ((gamma-1)/2)* MInlet^2) % for numerator
b1 = (MInlet/MInfinity)
r = b1*(a/b)^((gamma + 1)/(2*(gamma -1))) % for num and den
3 commentaires
Torsten
le 17 Mar 2024
I just would like to know if these are well coded?
Yes, the two expressions are correctly coded.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Gamma Functions dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!