Deleted variables reappearing in workspace.
显示 更早的评论
I am running a script with all the variables defined either in the script or in the base workspace. I have changed the names of some of the variables over time to be more concise. After these changes I have saved the workspace as well as all the scripts and functions I have been using. However, when I run one script in particular the old variables keep reappearing in the workspace and are being used by some of the other scripts. I have checked to make sure all names match the variables I want to use plus I have used clear, clearvars, and clearvars -global but they still keep reappearing. I have also tried to rerun my process from the beginning to try and eliminate residual variables. I have even tried to restart MATLAB and my computer to no avail.
Does anyone know of this issue and how to remedy it?
I can add the code here but I do not think it will be of much help. My problem is more with 'non-existing' variables popping up then the code itself. However, if someone thinks it will help I will gladly post it.
Thank you.
回答(1 个)
per isakson
2014-3-5
0 个投票
Seriously, using functions instead of scripts is a large part of the remedy.
类别
在 帮助中心 和 File Exchange 中查找有关 Workspace Variables and MAT Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!