Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: no standalone apps output in console
Replies: 5   Last Post: Feb 1, 2013 3:44 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 8,232
Registered: 6/7/07
Re: no standalone apps output in console
Posted: Feb 1, 2013 1:26 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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...

--





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.