App Designer unwanted figure opening on initial run?
Show older comments
Hi - this is my first app Designer app... Sometime after a few weeks of development, each time I start my mlapp, an empty figure pops up. I looked through the code using search and I don't have anywhere in the startup function specifiying a figure (or UIfigure). I can't find any call in my code for the unwanted figure. I moved my mlapp file over to a collegue's computer (we have a site license). If I open on his system, no figure pops up??? Sorry this is quite vague without seeing the code, but it almost seems like my app designer somehow got a default "open a non-UI figure" somewhere in settings? It can't be part of the mlapp if it doesn't spawn on antoher computer, correct? Any idea where I can find a setting for the mlapp designer which would request a non-UI figure during initial run??? Thanks in advance. Sorry, this is a very minor inconvenience, but it's now become an obsession to find!
6 Comments
Michael Van de Graaff
on 17 Jan 2022
Is it possible that It is opening on the other computer, but closes rapidly so you don't see it? Perhaps the other computer is faster or something?
Walter Roberson
on 17 Jan 2022
Is it when you start matlab or each time you run your app?
I suspect that you have a stray gca or gcf or hold call, possibly in a startup file
Image Analyst
on 17 Jan 2022
Edited: Image Analyst
on 17 Jan 2022
How can we find the culprit when you forgot to attach the .mlapp file? Please attach it with the paperclip icon.
What happens if you step through the startup code from the very beginning line-by-line? You should be able to find the line of code that creates the figure that way.
Thomas Boyd
on 17 Jan 2022
Michael Van de Graaff
on 18 Jan 2022
That does sound like a puzzle given your debugging efforts seem to be thwarted, my suggestion would be to start commenting out code until the behavior changes, that should rule out your code as an explanation beyond what you've already done. Or start with a blank app and incrementally add the code.
Is the other computer running an identical version of Matlab?
you might also try using findall https://www.mathworks.com/help/matlab/ref/findall.html, put that in your code and see if it can detect your phantom figure.
I completely understand how this would be extremely annoying and why you've become obsessed with fixing it. I would do the same.
Thomas Boyd
on 18 Jan 2022
Answers (1)
Thomas Boyd
on 26 Jan 2022
0 votes
Categories
Find more on Develop Apps Programmatically in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!