syntax error, Block error

3 Ansichten (letzte 30 Tage)
Ahmed Sayed
Ahmed Sayed am 13 Apr. 2018
Beantwortet: Rajanya am 14 Apr. 2025
This is a small model of my problem.it is a simulink file. The values did not change. I tried to solve this problem, but it does not work.
If any of this system need to change, change it I need the initial values to be zeros

Antworten (1)

Rajanya
Rajanya am 14 Apr. 2025
The errors in the model are due to the fact that the expressions within the 'Fcn' block must be in terms of a predefined input variable 'u', which represents the single input that the block takes in. However, the model contains expressions using the custom signal names (like 'e', 'b' etc.), which the 'Fcn' blocks do not recognize, leading to syntax errors in the expressions.
Replacing all the expressions with 'u', in place of the custom names, solves all syntax errors (You will still get errors because the model contains algebraic loop but that is a different issue).
An example model to demonstrate the usage is provided below:
[ Note - a) 'u+2' is essentially equivalent to 'u(1)+2', and b) using 'b+2' instead of 'u+2' throws syntax error! ]
To learn more about the 'Fcn' block in Simulink, you can refer its documentation page by executing the following command from MATLAB Command Window:
doc Fcn
Thanks!

Kategorien

Mehr zu Modeling finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by