How to retrieve the output from an executable file generated by MATLAB compiler on the windows command line
22 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hariharan MK
am 25 Mai 2021
Kommentiert: Hariharan MK
am 27 Mai 2021
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 Kommentare
Akzeptierte Antwort
Steven Lord
am 25 Mai 2021
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu MATLAB Compiler finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!