필터 지우기
필터 지우기

Changing autocoded function calls in Matlab 2008A & Realtime workshop

조회 수: 1 (최근 30일)
Jeffrey Zimmerman
Jeffrey Zimmerman 2015년 4월 27일
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?

답변 (0개)

카테고리

Help CenterFile Exchange에서 Code Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by