Info

此问题已关闭。 请重新打开它进行编辑或回答。

Fixed Point Scaling for RSim Executables

1 次查看(过去 30 天)
Ross
Ross 2011-4-26
关闭: MATLAB Answer Bot 2021-8-20
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??

回答(1 个)

Kaustubha Govind
Kaustubha Govind 2011-4-28
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.

Community Treasure Hunt

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

Start Hunting!

Translated by