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!