How to retrieve the output from an executable file generated by MATLAB compiler on the windows command line
9 ビュー (過去 30 日間)
古いコメントを表示
I have main file containing
function [array1, array2, array3] = myFunction(input1, input2, input3, input4)
% some code
end
I have compiled the main file using the MATLAB compiler to produce an executable file called "mainFile.exe"
On the command line, I call the excutable using the command,
mainFile input1 input2 input3 input4
My question is how do I get the 3 arrays which are supposed to be produced after the application has run. Is there a way to store them into a notepad or csv file?
If further clarification or information is needed, I will add in the comments.
Thank you!
0 件のコメント
採用された回答
Steven Lord
2021 年 5 月 25 日
As stated on this documentation page "You cannot return values from your standalone application to the user. The only way to return values from compiled code is to either display it on the screen or store it in a file." The easiest way would probably be to have a section of your program that calls save inside an if statement that checks if the code isdeployed.
if isdeployed
save(nameOfFile, namesOfVariablesToSave)
end
Or if you want them in a human-readable text file see some of the topics in this category in the documentation for MATLAB for alternatives to save for this application.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で MATLAB Compiler についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!