Peculiar behavior in compiled standalone
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi there
Just working through the motions of compiled code that throws an inexplicable error. The *.m "raw" file seems to work fine, but the compiled version (suing application compiler) throws the error "left and right sides have different number of elements" precisely at a function call, e.g. function [a,b] = myFun(x,y,z). Have gone through every single line of code, every combination of inputs, the *.m file works flawlessly but the compiled version blows up.
Looked at dependencies, linted the code, checked variable types, structure, DLLs and other ancilliary functions called, nothing works. The surprising issue is that all the outputs are defined or properly initialized. The *.m file works, as said. Took the function outside (as a separate *.m file) and nothing. Bundled it inside the main code, didn't help either.
Injected specific messages at specific places within the function (to see if it blew before or after any of them, once called) but the function refuses to run on its entry point (when it throws the error).
Any ideas?
댓글 수: 0
답변 (1개)
Steven Lord
2021년 8월 24일
Is the function in the standalone application that throws an error operating on one or more of the input arguments with which the standalone application is called? If so see "Using a MATLAB File You Plan to Deploy" on this documentation page.
You may think you're passing in a number, but you're actually passing in a char array.
x = 10
size(x)
y = '10'
size(y)
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Software Development Tools에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!