Force default datatype to single in undefined Simulink blocks
Show older comments
Hi,
I am working in Simulink and generate C code for an embedded target and I am facing an issue with the default data type. I put together a test model to describe my issue, I have the following:
1) Initialisation y = 1 in a Matlab Function
2) Stateflow with a signal set inside to value locParam = 1
3) Normal constant with Inherit from 'Constant value'
;.png)
I then do set_param('teest', 'DefaultUnderspecifiedDataType', 'single'); instead of the default 'double' I get the same result apart from the ground block which changes to single.
If I set the Constant to inherit via back propagation then the data type changes to single.

Is there a way to change a master setting to whenever the compiler sees a value unpecified defaults it to single without manually type casting them (i.e. for the Matlab function y = single(1) and for Stateflow locParam = single(1). Both the Matlab function and Stateflow have Inherit: Same as Simulink datatypes in the Property Inspector).
Thanks!
Accepted Answer
More Answers (0)
Categories
Find more on Event Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!