# Im trying to code the following equation (Attached) in MATLAB, could someone please tell me if i coded it right. Thanks

1 view (last 30 days)
Faraz Vossoughian on 15 Oct 2018
Commented: OCDER on 15 Oct 2018
eqn=Ma.*sqrt(gam.*R.*Ta).*((1+f).*sqrt(T04./Ta).*(1+((gam-1)./2).*Ma.^2).^(-0.5))-1

OCDER on 15 Oct 2018
eqn= Ma.*sqrt(gam.*R.*Ta).*((1+f).*sqrt(T04./Ta).*(1+((gam-1)./2).*Ma.^2).^(-0.5))-1
^ WRONG PLACE
Note: You do not need the dot-multiplier (.*) when multiply a scalar value to a matrix. Use the elementy-wise, dot-multiplier when multiplying two matrices together, element-by-element.
EX:
A = 1;
B = 2;
C = A * B; %OK
A = 1;
B = [1 2 3];
C = A * B; %OK
A = [1 2 3];
B = [1 2 3];
C = A .* B; %OK to use .* multiplier if you want C = [1 4 9].
OCDER on 15 Oct 2018
Believe in yourself Faraz! YOU need to be able to decide what's right or wrong yourself. The different levels of confidence...
"should it be after -1?" (lacking confidence because of fear of failing)
"it should be after -1 because the brackets surround -1" (justified confidence, failed and learned many times)
"it should be after -1 because I'm always right" (over confidence, failed a lot but never learned)
"it should be after -1 because others said so. " (false confidence, majority can be incorrect too)
But, are you even sure the bracket should be after -1? Just testing :)