Use of DataTypeOverride with Embedded Matlab Function

1 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Code Generation and Deployment 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by