how to delete mat file
조회 수: 95(최근 30일)
표시 이전 댓글
i have saved a variable by using
save('fp_database.mat','data');
i want to delete this file so i tried
delete('fp_database.mat')
now even i load it by load('fpnn_database.mat');its values are displayed and not deleted
please tell how to delete it
채택된 답변
Jan
2013년 1월 2일
Using Matlab's posibility to search a file in the complete list of folders in the path leads to such strange effects. It is recommended to use absolute file names instead:
File = fullfile(cd, 'fp_database.mat');
save(File,'data');
...
delete(File);
disp(exist(File, 'file'))
The current directory can be modified by GUI or TIMER callbacks, such that absolute file names are more secure in general also.
댓글 수: 2
추가 답변(2개)
Azzi Abdelmalek
2013년 1월 2일
편집: Azzi Abdelmalek
2013년 1월 2일
Try this
a=1:10;
save('fp_database','a')
delete('fp_database.mat')
clear
load('fp_database')
a
댓글 수: 0
Malcolm Lidierth
2013년 1월 2일
Looks like you have several copies in different folders on the MATLAB path. Delete only deletes the first. Try
which ('fp_database.mat')
after delete to find the 2nd.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!