Use of DataTypeOverride with Embedded Matlab Function

1 view (last 30 days)
Hi, we are using the Code Generation to create Code for our DSP from Simulink models. To increase calculation time on the DSP, we are setting DataTypeOverride to true, applying to all Floating-Point numbers. This works very fine so far. Now unfortunately, one of my colleagues uses a lot of embedded M-functions in his models, where sometimes he is assigning a number directly to a variable, e.g. y = 1; Now it seems like the DataTypeOverride function does not work on the number, because we get an error message "single ~=double". I guess the "1" is interpreted as a double. As soon as we multiply it with a Floating-Point Input to that function, or with a Parameter out of the workspace, e.g. y = 1*Param; it works. Does anyone know if it is possible to override all general numbers in embedded M-Functions also to singles? Or do we need that workaround as described? Thanks Tobias

Answers (0)

Categories

Find more on Code Generation and Deployment 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!