coder.EmbeddedCodeConfig: CustomSourceCode: How to specify multiple lines of code.
조회 수: 2 (최근 30일)
이전 댓글 표시
Using the CustomSourceCode property of the coder.EmbeddedCodeConfig class, you can add code to be inserted in the generated code. I use it to have a file included into my source code.
Now I want to include multiple files, and so I need to specify multiple lines or custom source code.
How can I specify multiple lines of source code in CustomSourceCode ?
I tried:
cfg.CustomSourceCode = '#include "file1.h"\n#include "file2.h"'
but that just results in
#include "file1.h"\n#include "file2.h"
in my source file, which doesn't compile.
댓글 수: 3
채택된 답변
TAB
2012년 8월 13일
cfg.CustomSourceCode = sprintf('%s\n\r%s',...
'#include "file1.h"','#include "file2.h"');
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!