What is wrong with my code it keeps telling me that i have 'Error: File: labmaterials.m Line: 67 Column: 109 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

1 回表示 (過去 30 日間)
Ms(iii)=2/pi*(w1*log*[tan*[acos*[w1/l_vector]]+l_vector/w1]+l_vector*(pi/2)-l_vector*acos*[w1/l_vector])(iii);

採用された回答

Star Strider
Star Strider 2020 年 11 月 18 日
The problems are too many to specifically enumerate:
Ms(iii)=2/pi*(w1*log*[tan*[acos*[w1/l_vector]]+l_vector/w1]+l_vector*(pi/2)-l_vector*acos*[w1/l_vector])(iii);
I have no idea what the ‘(iii)’ subscript refers to (I am guessing ‘l_vector’) however it cannot just sit there at the end of the statement, since it does not specifically refer to anything.
I have no idea if this will work and do the calculation you want, however the parentheses and function calls all appear to agree:
Ms(iii) = 2/pi*(w1*log(tan(acos(w1/l_vector(iii)))+l_vector(iii)/w1)+l_vector(iii)*(pi/2)-l_vector(iii)*acos(w1/l_vector(iii)));
Note the changes. Make appropriate edits to get the result you want.

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by