Fixed Point Scaling for RSim Executables

I have a complex simulation model that is used for transient analysis of non-linear systems. I have compiled the model with the rsim target for use as a standalone executable. My intention is to use the model's parameter structure to allow all parameter values (a large number) to be varied prior to each simulation run. The parameters are defined as a number of different data types including fixed point data types with a variety of scaling.
I am able to overwrite parameters in the parameter structure and simulate the executable after using the 'AddTunableInfo' option with rsimgetrtp. However, I am unable to identify the fixed point scaling of each parameter value in the structure. Does anyone know a way of identifying the scaling so that values can be correctly changed in the .exe??

Answers (1)

As is described on this page:
"The Simulink Coder software reports a tunable fixed-point parameter according to its stored value. For example, an sfix(16) parameter value of 1.4 with a scaling of 2^-8 has a value of 358 as an int16."
So it looks like you can't use the parameter structure to identify the scaling.

This question is closed.

Asked:

on 26 Apr 2011

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!