フィルターのクリア

how can i deleted unused data

3 ビュー (過去 30 日間)
Zhenwei Sun
Zhenwei Sun 2018 年 8 月 24 日
コメント済み: Zhenwei Sun 2018 年 9 月 3 日
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.

回答 (1 件)

Adam Danz
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
  1 件のコメント
Zhenwei Sun
Zhenwei Sun 2018 年 9 月 3 日
thx for your inf. yes, currently I used pre-save and pre-load command to save/load the base workspace data to a .mat file. I will try on your examples.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by