Error in Matlab2017b coder: the extrinsic function "size" is not available for standalone code generation.
이전 댓글 표시
m-scripting file is executing without errors. While generating the C-code using "Coder", i am getting the errors for the functions "Size" and "xmlread". Erros is attached for reference.
.댓글 수: 2
Matan Silver
2023년 9월 14일
Hi Pradeep,
To best investigate some of these errors and help you resolve them, could you provide a short reproduction script that will produce these errors?
I will try to help as much as I can with the information here. Are you explicitly declaring certain functions extrinsic using "coder.extrinsic"? If so, the errors relating to standalone code generation are accurate--standalone code can't use the output of extrinsic functions because that requires calling into MATLAB (and standalone code must work without MATLAB).
Regarding the function "xmlread" which you mentioned--"xmlread" does not support code generation. The development team is aware of this limitation. There are a few workarounds to the lack of support for now:
- You can use "coder.write" and "coder.read" to store and read structured data: https://www.mathworks.com/help/coder/ref/coder.write.html, https://www.mathworks.com/help/coder/ref/coder.read.html.
- You can use "coder.load" if you are ok with the contents of a file being read only once during code generation and stored as a constant in the generated code itself.
- You can use "fscanf" if you can put your data in a text file with a simple-enough format: https://www.mathworks.com/help/matlab/ref/fscanf.html#refsect-extended-capabilities
None of those solutions will read from an xml file, but if you use a different file format for this application, you might be able to use one of those options.
Let me know if you can upload some reproduction examples. Thanks,
Matan
B Pradeep Kumar
2023년 9월 20일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB Coder에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!