how can i deleted unused data
조회 수: 4 (최근 30일)
이전 댓글 표시
I’m copy a part sub-module from another project, and implement in my new project. I also copy all the data/signal define to base workspace to avoid any mistakes. But after success built my new project, how can I remove all the data/signals which not used in my project. Or only save the data/signals which used in my project.
댓글 수: 0
답변 (1개)
Adam Danz
2018년 8월 24일
Don't delete the data. Data storage is cheap these days so just keep it. If you're talking about removing the data from your mat files, that's another story.
Option 1 is to only import the data you need in the first place. It's much more efficient to import only the needed data rather than importing all of the data and then removing what's not needed.
Option 2, if you've already got your mat files and you have the need to clean them up or reduce file size, assuming the data you want to remove is stored somewhere else for future reference, here's how to remove selected variables:
Assuming your mat file is loaded into the workspace, remove variables "var1" and "var2" like this:
clear('var1', 'var2');
Then save your mat file, overwriting the existing file.
If you're trying to remove variables from a mat file that isn't loaded into the workspace, see this (I've never used). https://www.mathworks.com/matlabcentral/answers/254048-how-can-i-delete-variables-in-my-mat-file-without-loading-them-into-matlab-7-2-r2006a#comment_472754
참고 항목
카테고리
Help Center 및 File Exchange에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!