MATLAB Answers

matlab app designer where is the workspace?

11 views (last 30 days)
Robert Scott
Robert Scott on 1 Aug 2021
Commented: Image Analyst on 2 Aug 2021
ok so im a bit confused. I used the old version of this some years ago.
In the old app guide you had access to variables in your work space and could debug the app as normal.
If i for example have a simply app that does nothing but return the sum of somthing and have a variable called sum.
Where is that? I dont see a workspace where its kept?
How do i debug this thing if i dont have access to the workspace variables?
Any ideas?

Accepted Answer

Sylvain
Sylvain on 1 Aug 2021
HI Robert,
my own technique is to add a push button call debug. The callback of the push button uses the function assign('base','VariableName',VariableToExtract). This allow to get the data from the app into the workspace.
Depending on how you coded the app, the VariableToExtract may be found in app.ObjectParent1.Object.PropertyToExtract. Or similar.

More Answers (1)

Image Analyst
Image Analyst on 1 Aug 2021
Robert,
Yes, this is what I've been complaining to them about for years. I've even talked in person to the developers in Natick about it and they know my views and why this is a complete show stopper for me moving to App Designer.
I'd happily move to App Designer because it has some nice things about it, like more advanced widgets/controls, but having the Current Folder, Command Window, and the Workspace panel in a separate app (the main MATLAB IDE) and the GUI designer and source code in a separate app (App Designer) is a total deal breaker for me. I can't be thrashing windows all the time when I want to debug. It might be OK for people with two monitors (MATLAB IDE on one monitor, and App Designer on the other monitor), but for those of use with laptops, or who prefer a single monitor, it's a total deal breaker.
If I were you I'd call them on the phone and complain. Please, please do this. The more of us that complain, perhaps the quicker they'll fix it. I think they understood my complaints but I don't know how much of an effort it is to fix it. Frankly I don't even know if they will fix it -- they just said they understood my complaints and understand how it's a hinderance to a productive workflow. Every release I check, but no luck so far.
Until they fix it, you're stuck with dealing with two separate apps and thrashing over to the "correct" window when you want to do something. A real pain, I know, believe me.
  5 Comments
Image Analyst
Image Analyst on 2 Aug 2021
Wow - another reason for me to hate App Designer. Are you just putting the loop counter on its own line without a semicolon, using disp(), or using fprintf()? You might try it all three ways and see if one of them works.
Or you might try the drawnow command.
drawnow;
It works very well for updating GUIs. I'm just not sure if it will work on the command window panel but it's worth a try.

Sign in to comment.

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by