Supported Matlab Functions in Simulink

조회 수: 5 (최근 30일)
Joshua
Joshua 2013년 5월 20일
Hello, I have a simulink simulation that is keeping track of the Julian Date through out the simulation.
At one point in the sim, I need to convert the Julian Date to a decimal year. The equivalent code in MATLAB would be:
decimal_year = decyear(Julian_Date - 1721058.5);
decyear is a built-in matlab function, however I'm getting an error saying that decyear is not valid for code generation.
I am aware that this is the case, however I do not need to generate any code involving the conversion and have since removed the %#codegen line in the embedded matlab function.
The problem is I'm getting the same error again. Is there anyway to solve this problem so I can use the decyear function in simulink?
  댓글 수: 1
David Barry
David Barry 2013년 5월 20일
Simulink needs to generate code for the MATLAB function block even in normal mode. You should refer to the list of supported functions http://www.mathworks.co.uk/help/simulink/ug/functions-supported-for-code-generation--alphabetical-list.html

댓글을 달려면 로그인하십시오.

채택된 답변

Guy Rouleau
Guy Rouleau 2013년 5월 20일
Use coder.extrinsic if you do not need to generate code.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by