Multiple windows opened when executing a matlab standalone program
13 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I am trying to create a standalone program on Win7 that just open a figure and plot a simple function. For example, my program just execute the following two lines: figure(1); plot(1:10,sin(1:10));
I used Matlab Compiler to compile a standalone program (.exe) that works well. The problem is that before creating the figure, several windows are opened (Command Window, Command History, Help, Workspace, Current Folder and Editor).
Is there a way to avoid the opening of these windows?
Thanks in advance.
3 comentarios
amit pathania
el 18 de Abr. de 2012
How to create standalone applications in MATLAB 2012?I am not getting errors while running MATLAB compiler.If someone can help me with steps starting from which all compilers MATLAB 2012a supports?
Respuestas (2)
Eero Kuusi
el 10 de Feb. de 2012
I have had the same problem for ages. I made a workaround as follows:
This effectively removed the duplicate window from opening. However I'm making alterations in my program (putting in copy protection algorithms to be exact) and I must somehow prevent the dual launching from happening. Any advice would be greatly appreciated, I haven't been able to solve this problem.
I'm running r2009a (same thing happens for all earlier versions as well).
br, Eero
2 comentarios
Eero Kuusi
el 13 de Feb. de 2012
Script is a .m file that doesn't have any functions inside. But it shouldn't make a difference if the main .m file a script or a function, both seem to work fine.
Here's a mock version of a standalone program that uses my modification:
global STARTUP_COMPLETE
if STARTUP_COMPLETE
return
end
disp('Hello World!')
STARTUP_COMPLETE = 1;
This should prevent 'Hello World!' from being displayed twice when you run the program. Naturally, it should prevent anything after the if clause to be run twice. It worked fine for me until I made some more complex modifications.
Ver también
Categorías
Más información sobre Graphics Object Programming en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!