Filter löschen
Filter löschen

Abs in stateflow chart

32 Ansichten (letzte 30 Tage)
David Jose
David Jose am 8 Mai 2018
Beantwortet: Yoke Peng Leong am 17 Mai 2018
In stateflow transition label, am using abs command to do the math. example:Transition [(abs(a)> abs(b))], While doing the code generation using Embedded coder,in the auto generated C file 'abs' is replaced with a Conditional operator statement example: (a>0? -a: a ). I want to retain the 'abs' term in the code so that readability will be good.

Antworten (1)

Yoke Peng Leong
Yoke Peng Leong am 17 Mai 2018
Currently, there is no straight forward way of doing that.
An option is to use coder.ceval('abs',a) in Stateflow in order to force the code generation to use abs.
I have forwarded this feedback to the relevant team in MathWorks.

Kategorien

Mehr zu Stateflow finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by