Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
dpb
Posts:
6,846
Registered:
6/7/07
|
|
Re: no standalone apps output in console
Posted:
Feb 1, 2013 1:26 PM
|
|
On 2/1/2013 11:36 AM, Michal Kvasnicka wrote: > I have function: > ======================================== > function m = magicsquare1(n) ... > m = magic(n); > ======================================== > >>> magicsquare1(5) > > ans = > > 17 24 1 8 15 ... > >>> mcc -mv magicsquare1.m > (of course MRC is properly installed and configured) > > Then the standalone application "magicsquare1" does not produce any > output in command-line console!!! But it should, according to the help > page of MATLAB compiler.
Link???? Don't have the compiler here so didn't try to confirm this...
> When I change the function like this: > ======================================== > function m = magicsquare2(n) ... > m = magic(n); > disp(m); > ======================================== > and recompile ... > I am able to get correct output. ... > So my question is: what is wrong? Why I am not able to get output from > standalone application magicsquare1? ...
I'd guess nothing is wrong but probably your interpretation of the documentation...
In the first case you see results at the command line inside ML because the command interpreter snags the return variable in the hidden default return target 'ans' and displays it.
OTOH, when you compile it, there's nothing in the code that indicates anything to the compiler that the output should be displayed since you included the ';' on the subject line that defines the return variable so I'm not surprised the compiler didn't generate output display code internally automagically.
What happens if you use
m = magic(n) % NB: no ";"
instead out of curiosity?
Also as noted, would be interested in the actual documentation reference to see precise wording...
--
|
|
|
|