Info
此问题已关闭。 请重新打开它进行编辑或回答。
Fixed Point Scaling for RSim Executables
1 次查看(过去 30 天)
显示 更早的评论
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??
0 个评论
回答(1 个)
Kaustubha Govind
2011-4-28
"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.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!