Matlab is not showing my workspace variables, even though they do exist
178 views (last 30 days)
Show older comments
I recently installed the R2023a version of Matlab, and after a few days of using it without any problems, the vairables in my workspace are not showing up anymore. My script runs without any errors, and I can see that the variables are indeed created when I hover my mouse over the workspace section. It seems like this is just a visual bug..
Does someone know if this is fixable? Restarting Matlab doesn't work.
8 Comments
Muhammad Tauha Ali
on 9 Oct 2023
not sure if it'll violate any confidentiality guidelines (moderators can remove this post if it does):
"Thank you for reporting this issue. I took your query into consideration. Please note that the “New Desktop for MATLAB” currently is in the Beta version and is still undergoing development. For a more stable and bug-free experience, I kindly recommend reverting back to the regular desktop environment.
As of now I am going ahead and closing this case. If you have any further questions regarding this case, feel free to reply to this email thread, I will be happy to reopen and assist you further."
Image Analyst
on 9 Oct 2023
@Nils van der Gaag from the screenshot you showed, it does not look like you are using the new desktop. If you were, there would be buttons in the titlebar in the upper right saying "Feedback" and "Stop New Desktop". I don't see that on your screenshot. Even if the new desktop had been installed previously, there would be a button saying "Try the new desktop" and I don't even see that so you never went into the Add-ons Explorer and downloaded the new desktop. There is some miscommunication going on here.
Answers (1)
Pooja Kumari
on 21 Sep 2023
Dear Nils,
It is my understanding that you are facing issue with no variables in workspace after successful execution of script with R2023a version of MATLAB. I hope that you are facing this issue only with this MATLAB script and other scripts are working fine with all the variables being created and shown in workspace.
There are few troubleshooting steps that are given below:
- Variables in your workspace may not be visible because you are working with function files instead of script files. One important distinction between scripts and functions is that functions have their own separate workspace. This means that any calls to a function do not overwrite the values in the base workspace. You can refer to the below documentation for more details on function vs scripts: https://www.mathworks.com/help/matlab/matlab_prog/scripts-and-functions.html
- The scope of variables defined within a function is limited to that specific function. Once the function is exited, these variables vanish and are no longer accessible.
- To view the function workspace, you can add breakpoints in your code by clicking to the left of the code (next to the line number). This allows you to step through the code and examine the function workspace. You can refer to the below documentation for more information on breakpoints: https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html
- Currently, even if there are no variables in the workspace, attempting to delete variables will prompt a pop-up message stating that the variables in the workspace will be deleted.
Another troubleshooting step will be signing out of MATLAB and again signing in. If the issue persists, try re-installing MATLAB.
Regards,
Pooja Kumari
2 Comments
Dyuman Joshi
on 21 Sep 2023
You seem to have misunderstood the problem - The variables exist, are present in the workspace after the (successful) execution of the script, but there is a problem with display.
This is most likely a visual bug, as OP suspects and the best way to resolve it would be to contact Support as Stephen23 has indicated.
Yau Jack
on 12 Feb 2024
Same here, Im using online matlab and variables are not showing inn workspace.
However when mouse point on top the ariables on the script, it shows the values.
See Also
Categories
Find more on Startup and Shutdown 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!