MATLAB: Do I receive the error “MATLAB:un​assignedOu​tputs” when executing the stand-alone application that was generated with MATLAB Compiler 4.0 (R14)

MATLAB Compilermatlab:unassignedoutputs

I have a function implemented as follows:
function out = test
plot(1:10);
When I call this function from MATLAB, the plot displays and the figure remains open as expected.
I then compile my function as follows:
mcc -m test
When I execute the resulting executable test.exe, I receive the following output:
One or more output arguments not assigned during call to '$dir\test_mcr\test\test.m (test)'.
MATLAB:unassignedOutputs
The plot opens but then immediately closes.

Best Answer

This enhancement has been incorporated in Release 2006b (R2006b). For previous product releases, read below for any possible workarounds:
There is a bug in MATLAB Compiler 4.0 (R14) in the way that an error is generated when executing a stand-alone application that does not assign a value to one of its output arguments. As a workaround, remove the function's output variable:
function test
plot(1:10);
or assign a value to the function's output variable:
function out = test
plot(1:10);
out = 1;