invalid expression in the for loop

16 ビュー (過去 30 日間)
OYH
OYH 2019 年 11 月 22 日
回答済み: Walter Roberson 2019 年 11 月 22 日
Screen Shot 2019-11-22 at 11.12.26.png
So, this is the project that I'm working on right now. And the problem is the for loop. It gets error message saying.Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.
I don't know what is the wrong part.
Also, one can give some suggestion for my code if it is really clumpsy.
Really appreciate if someone can help

採用された回答

Walter Roberson
Walter Roberson 2019 年 11 月 22 日
You are missing a ) after the / in the line you indicate. Count the brackets
(1+(velocity(1,i)^2).^(3/2)
1 2 3 2 1 2 1
You need one more ) character.
I suspect you could instead use
(1+velocity(1,i)^2).^(3/2)

その他の回答 (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