Error on Beta Theta Mach equation

I am trying to turn the following code into the formula below but I'm not sure what I am doing wrong and keep getting an error. Could somebody fix this for me? Thank you
beta = 35; %example values
m = 2;
gamma = 1.4;
theta = atan((m^2*sin(beta)-1)/(m^2(gamma+cos(2*beta))+2));
File: btm.m Line: 4 Column: 36
Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

回答 (1 件)

Dyuman Joshi
Dyuman Joshi 2023 年 12 月 14 日

0 投票

You are missing a multiplication operator in between M1^2 and the bracket expression in denominator, see below -
Note that if you are providing beta in degrees, the trignometric functions used will also have to be the ones that use degree as input i.e. sind instead of sin.
beta = 35; %example values
m = 2;
gamma = 1.4;
% v v V v
theta = atand((m^2*sind(beta)-1)/(m^2*(gamma+cosd(2*beta))+2))
theta = 8.2124

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

製品

リリース

R2023b

タグ

質問済み:

2023 年 12 月 14 日

回答済み:

2023 年 12 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by