Deleting within .mat file
이전 댓글 표시

Hello,
This is a screenshot of my MAT-file. How do you permantly delete certain structures? For example, if I want 'B' deleted.
I used to be able to right click on the one I wanted to delete, and it gave me options to delete, duplicate, move, etc, but one day it stopped letting me do that. Does anyone know why it no longer lets me delete right in that window? Is there something I need to enable?
Thanks!
채택된 답변
추가 답변 (2개)
Use clear command as e.g
clear B W X Y Z
or
clearvars B W X Y Z in your script file or the function file in the end line
So, when you save the workspace variables as *.mat they will not appear in the *.mat file when you load it back into workspace
댓글 수: 4
Walter Roberson
2020년 8월 15일
is there documentation for that? I do not find it. https://www.mathworks.com/help/matlab/ref/clear.html
VBBV
2020년 8월 15일
Agree with you Walter, there is no documentation for it
Sclay748
2020년 8월 17일
Walter Roberson
2020년 8월 15일
1 개 추천
A work-around that is sometimes good enough is to create the variable locally with empty contents, and save with the -append flag. The old variable in the file will be marked as unused and the new empty variable will be saved in the file.
This does not completely remove the variable from the file: the variable name would still be there, just associated with empty content. But the previous content would no longer be associated with the name.
카테고리
도움말 센터 및 File Exchange에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!