Why no output from standalone application when run in Windows?
Show older comments
How can I see the output from a standalone application compiled from Matlab, when I run the application in Windows?
Here's what I tried, but no output is shown. First, the mfile,
function [numOutput1, numOutput2, strOutput1, strOutput2] = test_compiled1(numInput1, numInput2, strInput1, strInput2)
% Convert inputs to numeric
if isstr(numInput1)
numInput1 = str2double(numInput1);
end
if isstr(numInput2)
numInput2 = str2double(numInput2);
end
% Do something with inputs and outputs
numOutput1 = numInput1.^numInput2;
numOutput2 = numInput1 - numInput2;
strOutput1 = [strInput1 '_' strInput2];
strOutput2 = [strInput2 '_' strInput1];
%% Return the output by displaying the results
disp([num2str(numOutput1) ' ' num2str(numOutput2) ' ' strOutput1 ' ' strOutput2 ])
When I run it in Matlab, it displays the output,
test_compiled1(2, 3, 'a', 'b')
8 -1 a_b b_a
Then I compile it as follows,
fileMatlab = 'test_compiled1.m';
buildResults = compiler.build.standaloneApplication(fileMatlab);
compiler.package.installer(buildResults);
In Windows, I navigate to the directory that test_compiled1.exe is in, and run it as follows,
.\test_compiled1.exe 2 3 "a" "b"
Nothing is displayed and it takes ~30 seconds to run. Putting a and b in single quotes or no quotes at all doesn't change this. And if I pipe the output to a log file and an error file, both are empty.
.\test_compiled1.exe 2 3 "a" "b" >output.log 2>error.log
How can I see the output of this standalone application from Windows?
Accepted Answer
More Answers (0)
Categories
Find more on Get Started with MATLAB Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!