フィルターのクリア

i have encountered a parse error, how do i fix it ?

6 ビュー (過去 30 日間)
shabnam sh
shabnam sh 2019 年 2 月 22 日
編集済み: shabnam sh 2019 年 2 月 22 日
Hello everyone ,
I am supposed to write a function to calclate the gaze formula ,
i have written this :
function boolanswer = isingaze1 (Xbb,Ybb,cx , cy , a , b , tdegree)
boolanswer = (((Xbb - cx)cos(tdegree)+(Ybb-cy)sin(tdegree))^2)/(a^2)+(((Xbb-cx)sin(tdegree)-(Ybb-cy)cos(tdegree))^2/(b^2)<=1
end
but there is an error with the first cos , "Error: File: isingaze1.m Line: 3 Column: 26
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To
construct matrices, use brackets instead of parentheses."
i cannot figure out what the problem is ?
would you please help me ?
  2 件のコメント
Gani
Gani 2019 年 2 月 22 日
編集済み: Gani 2019 年 2 月 22 日
what are the input to your function ? all integers (Xbb,Ybb,cx , cy , a , b , tdegree) ?
Also please give the formula.
shabnam sh
shabnam sh 2019 年 2 月 22 日
yes they are ,
i have mentioned the formula , the second line is the formula .

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

採用された回答

Bjorn Gustavsson
Bjorn Gustavsson 2019 年 2 月 22 日
You have terms like:
(Xbb - cx)cos(tdegree)
That's not allowed, you have to explicitly put a '*', '.*' , '/' or a './' between the parenthesises. Also read the error-message and look at your code with intent to understand the error message.
HTH
  1 件のコメント
shabnam sh
shabnam sh 2019 年 2 月 22 日
編集済み: shabnam sh 2019 年 2 月 22 日
thank you very much ,

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by