How to retrieve the output from an executable file generated by MATLAB compiler on the windows command line

조회 수: 12 (최근 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!

채택된 답변

Steven Lord
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 CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by