필터 지우기
필터 지우기

Convert a sub function within an M file

조회 수: 1 (최근 30일)
Phil Hough
Phil Hough 2022년 4월 4일
답변: Denis Gurchenkov 2022년 4월 4일
A *.m file has a number of functions within it. How do I use the MATLAB coder to convert only one of the sub functions?
I have already converted many functions that are the file is named after
I open the MATLAB Coder App
select the m file with the function in it
Then try to add the subfunction entry point, which it cannot find.

채택된 답변

Denis Gurchenkov
Denis Gurchenkov 2022년 4월 4일
Hi Phil,
A subfuncton cannot be an entry point for MATLAB Coder. You'd need to move that subfunction into a separate .m file, then the App will pick it up.
If this is truly a subfunction (not a nested function) then such a move should be painless, you literally cut-n-paste the function body into a .m file with the same name as that function name. The original code will continue to work (it'll find the function in the .m file in the same folder).

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by