Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

4 ビュー (過去 30 日間)
I am getting an error for the below code:
The eroor is shown as:
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.
num_of_element = length(theta);
mean_square_err = [];
for n = 1: length(perm)
perm(n)
mean_square_err(n) = get_MSE(perm(n),theta, Tao_lin, num_of_element)
end
function mse = get_MSE(ep_value,theta,Tao_lin num_of_element)
nom = cos(theta*pi/180)- sqrt(ep_value-(sin(theta*pi/180)).^2)
den = cos(theta*pi/180)+ sqrt(ep_value-(sin(theta*pi/180)).^2)
Tao_hat = (abs(nom./den))
mse = 1./(num_of_element).*sum((Tao - Tao_hat).^2);
end
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 2 月 24 日
I do not see anything obvious. Can you attach the code as a file for us to check in case there are odd characters that we cannot see?
Mahfuza Khatun
Mahfuza Khatun 2020 年 2 月 24 日
Thank you so much. I fixed the probelm.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeOther Formats についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by