x = [0:pi/2:2*pi]
y = -(sin(pi/2*cos(x))(-pi/2*sin(x))/cos(x)
Keep getting the "Error: ()-indexing must appear last in an index expression." I understand what the error means, but I've tried replacing some of the () with {}, and I'm still getting the same error. I guess I am unsure which () need to be replaced to {}.

 採用された回答

madhan ravi
madhan ravi 2019 年 9 月 9 日

0 投票

y = -(sin(pi/2*cos(x))Operator missing here(-pi/2*sin(x))./cos(x)

1 件のコメント

madhan ravi
madhan ravi 2019 年 9 月 9 日
Also there’s an extra parenthesis at the beginning of the equation. See https://in.mathworks.com/help/matlab/matlab_prog/array-vs-matrix-operations.html

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by