Why is my workspace empty after running a script?
Afficher commentaires plus anciens
After running a script, there is neither variable 'a' nor 'ans' shown in workspace, but I can still use the command 'whos' to make them appear in the command windows. How to fix my workspace?

6 commentaires
Jan
le 12 Juin 2021
Your screenshots show the details, which are working as expected. To understand, what you problem is, it would be useful to show us, what is not working. Obviously the workspace is exactly, what it is expected. Maybe you mean the contents of the workspace browser? Then please show use a screenshot of this and mention the versione of Matlab and the operating system.
hongkang ni
le 12 Juin 2021
Jan
le 12 Juin 2021
What is this on the right side:

Did you scroll die displayed area down? The other scroll bars look different.
Image Analyst
le 12 Juin 2021
Good point Jan. Sharp eyes. I tried to scroll a few things in my workspace panel off the top but I don't get a scroll bar at all unless there are enough variables to need one, so I could not scroll them away. Which makes me wonder exactly what is that panel? What does the top of that panel say? Does it say workspace? If you click the little down arrow do you see an option that says "Dock" or "Undock"?
What happens if you put this line in your script for either line 1 or 2:
workspace; % Make sure the workspace panel is showing.
Does a different panel show up?
hongkang ni
le 13 Juin 2021
Image Analyst
le 13 Juin 2021
I'd just call tech support and tell them it's not installing properly because nothing shows up in the workspace panel. If I run your code, it shows up just fine. The tech support for installation is free (even for student editions) and fast.
Réponses (1)
Image Analyst
le 12 Juin 2021
1 vote
Something is not right with what you've shown. You have a semicolon after the "a=1" so that means when you type Untitled into the command window it should not echo the value of a to the command window as you have shown. Please give us the actual code. Like, maybe you declared it as a function instead of a script so that the a vanishes after the function completes execution.
When I do it, the a does not echo to the command window, and the a is definitely in the workspace panel.
1 commentaire
hongkang ni
le 12 Juin 2021
Catégories
En savoir plus sur Environment and Settings dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!