1

I have created a standalone application in Matlab, actually it works, it displays the desired output but it closes immediately, not even enough time to examine the output and read the error message on DOS (standalone mode) that says:

MATLAB:TooManyOutputs 
Warning: 1 visible figure(s) exist at MCR Termination

If your application has terminated unexpectedly, please note that
applications generated by the MATLAB Compiler terminate when there are no
visible figure windows. See the documentation for WaitForFiguresToDie and
WAITFORCALLBACKS for more information.

Any help would be appreciated.

Jonas Heidelberg
  • 4,984
  • 1
  • 27
  • 41
Mary Ann
  • 133
  • 1
  • 10

1 Answers1

1

Looking at the first line of your message, TooManyOutputs suggests that you have an assignment somewhere of the form

[a b] = somefunction(parameters)

so you want the outputs of somefunction to be put in a and b, but somefunction only returns one parameter. This bug causes your program to terminate, and then MCR realizes the program exits without closing your figure window, causing the later error messages.

If I'm right about TooManyOutputs, you should already have that error message when running your code directly in Matlab; have you tried that before creating a standalone application?

If this doesn't help, you should probably post some of your code to make it clearer where the problem could come from.

Jonas Heidelberg
  • 4,984
  • 1
  • 27
  • 41
  • thanks for the response, so i guess this cause the bug [xi,yi] = getpts1(get(p1,'Parent')); but i don't get the same error on the matlab command window, it works just fine. how can it be fixed :D – Mary Ann Feb 20 '12 at 14:07
  • `getpts1` doesn't seem to be a standard function, so I can't help there. If you mean `getpts`, this is probably *not* your problem, since that function *does* return two values. – Jonas Heidelberg Feb 20 '12 at 14:22
  • i changed it to `getpts` and it doesn't cause trouble, it still works fine but still get the same error, what about this `[y,x,z]=size(newimg);` can this give the bug ? – Mary Ann Feb 20 '12 at 14:43