MATLAB Answers

How to use max inside Simulink Fcn block?

30 ビュー (過去 30 日間)
rotton 2019 年 9 月 24 日
コメント済み: rotton 2019 年 9 月 24 日
In my Simulink sheet, I have a Fcn block which does a very simple calculation from its input:
Since the input can sometimes assume (unphysical) negative values, I wanted to exlude them:
max(0, u(36)/u(38)*u(39))
But as soon as I call the simulation, I get
The expression: max(0, u(36)/u(38)*u(39))
in '.../.../...'
has a syntax error
So does that mean that max is undefined inside Fcn blocks? If so, what could I use instead?
  2 件のコメント
rotton 2019 年 9 月 24 日
> Just to confirm are you referring this block?: Fcn
Yes, indeed. I also noticed that the max function is not part of the list of available (mathematical) functions.



Walter Roberson
Walter Roberson 2019 年 9 月 24 日
Math Function Blocks do not accept expressions: they only accept keywords.
You can build max() against a constant with or with Saturate blocks.

その他の回答 (0 件)




Community Treasure Hunt

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

Start Hunting!

Translated by