Syntax error Please help.

The expression:
u(5)*sin(u(1))*sec(u(2)) + u(6)*cos(u(1))*sec(u(2))
has a syntax error.
What is error, anybody guide me please.

9 件のコメント

Walter Roberson
Walter Roberson 2019 年 9 月 17 日
That expression is fine in itself. There might be problems with the surrounding code.
What is the error message you are getting?
Muhammad Azeem
Muhammad Azeem 2019 年 9 月 17 日
The expression: u(5)*sin(u(1))*sec(u(2)) + u(6)*cos(u(1))*sec(u(2))
in 'File_Name'
has a syntax error
Walter Roberson
Walter Roberson 2019 年 9 月 17 日
Is this in the context of a Simulink Function Block (also known as a Math Block) ?
Muhammad Azeem
Muhammad Azeem 2019 年 9 月 17 日
Yes
madhan ravi
madhan ravi 2019 年 9 月 17 日
Show the model.
Muhammad Azeem
Muhammad Azeem 2019 年 9 月 17 日
Can I share via email?
Muhammad Azeem
Muhammad Azeem 2019 年 9 月 17 日
Walter Roberson
Walter Roberson 2019 年 9 月 17 日
Is it possibly an Interpreted MATLAB Function block? https://www.mathworks.com/help/simulink/slref/interpretedmatlabfunction.html
It is worth experimenting to see if removing the spaces helps.
Walter Roberson
Walter Roberson 2019 年 9 月 17 日
R2019b does not find any error in that .mdl that you attached.
However,
Found algebraic loop containing:
Spacecraft_control_Magnetic/B_dot3
Spacecraft_control_Magnetic/Derivative2 (algebraic variable)
Spacecraft_control_Magnetic/B_dot2
Spacecraft_control_Magnetic/Derivative1 (algebraic variable)
Spacecraft_control_Magnetic/B_dot1
Spacecraft_control_Magnetic/Derivative (algebraic variable)
Spacecraft_control_Magnetic/B3 (algebraic variable)
Spacecraft_control_Magnetic/B2 (algebraic variable)
Spacecraft_control_Magnetic/uz (algebraic variable)
Spacecraft_control_Magnetic/ux (algebraic variable)
Spacecraft_control_Magnetic/B1 (algebraic variable)
This warning is correct: you feed the output of those variables right back as inputs, without there being any time delays. In order for that to be mathematically possible, the outputs would have to be steady-state, and working that out requires algebraic equations.

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

回答 (0 件)

カテゴリ

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

製品

タグ

質問済み:

2019 年 9 月 17 日

コメント済み:

2019 年 9 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by