Changing autocoded function calls in Matlab 2008A & Realtime workshop

1 visualización (últimos 30 días)
I am using simulink and real time workshop to generate code for a MCP5554 processor. In the simulink model, I am using the default ABS block with single precision values.
When I generate the code, it uses fabs() functions for those blocks.
I'm using Greenhills OS and the multi compiler to generate the final image. There are several options for the ABS function in the ANSI/math.h file: double fabs __ARGS((double));
In my debugger, I can see the CPU is converting my single precision input to a double, getting the abs value, then converting the double back to single.
In the same ANSI/math.h file, I see another function: float fabsf __ARGS((float)); If I manually search the autocoded c file for fabs and relplace it with fabsf. It compiles and executes fine and reduces my cpu utilization by 5%.
Is there a way to force the autocoder to call the fabsf function instead of fabs?

Respuestas (0)

Categorías

Más información sobre Prepare Model Inputs and Outputs en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by