How do I get my command window to load a workspace previously saved?
Show older comments
I have saved the workspace but can't get it to reopen when I log back into Matlab. The code won't load up.
7 Comments
Walter Roberson
on 6 Jan 2021
You do not show any error message, and you do not show what is in the workspace before and after. What you did show would be consistent with the load() having succeeded.
William Skidmore
on 6 Jan 2021
William Skidmore
on 6 Jan 2021
Steven Lord
on 6 Jan 2021
If you look at the variables stored in that MAT-file and what is in the workspace after the load call executes, you should see those variables in the workspace.
What's in the MAT-file:
whos('-file', 'Matlab Refresher Plotting Vectors.mat')
What's in the workspace:
whos
What specifically did you expect the state of MATLAB to be after you loaded that MAT-file? What variables do you expect to exist that don't? Do you expect MATLAB to resume running your code? Do you expect figure windows to be open?
Walter Roberson
on 6 Jan 2021
In the case of graphics objects:
If you load() a graphics object, then it will not be displayed if the Visible property for it in the file was set off.
People sometimes set the visibility of a figure to off, and save the figure, and then when they load the mat file nothing shows up... because the figure now exists but is not visible.
Gavin Gluckle
on 1 Oct 2021
Hi I'm having the same problem, I am wondering if you figured out a way to display the command window for saved matlabs.
Walter Roberson
on 2 Oct 2021
save() does not store the contents of the command window. If I recall correctly it is possible to query what is in the command window buffer and save that as a variable, but I am not sure there is a way to insert it back into the command window after loading.
Perhaps you might prefer to use Live Script.
Answers (0)
Categories
Find more on Whos 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!