MATLAB: Am I not able to obtain the Stored Integer (SI) value from a fixed point number in a Stateflow chart

basecodedoublefixedint8integermacronumberpointpowerrealrwvsistateflowstoredvalueworld

I want to access the Stored Integer (SI) value from a fixed point number in a Stateflow chart. I can obtain the integer part of a fixed point number, but there seems to be no method for obtaining the Stored Integer value.

Best Answer

The ability to obtain the Stored Integer value from a fixed point number in Stateflow is not available at this time.
As a workaround, define a macro to use a simple C-function call that returns long(x) for the input argument 'x'. That will provide the Stored Integer value.
As reference, see the attached model. In the Stateflow chart, note that 'a' is a fixed point number and 'op' contains the stored integer value. Notice that the C-code is included under 'Include paths' under Target options in the Stateflow chart and the macro is defined under 'Include code'.