ONLY load matfiles that contain a variable
이전 댓글 표시
Hi Guys,
I want to detect if a .mat file contains a variable before the script loads it. for the script that I am writing I only want one data set and there are 8297 files to check, so to save time and prevent crashes I only want to load faultsActiveList. However because there are not always faults active it is not always present.
DATA = load(MATfile,'faultsActiveList')
please bear in mind allthough I am the author of many of the scripts I use I do use some that others in my company wrote and they are p.coded so I cannot effect how the data comes to me.
Many Thanks James
채택된 답변
추가 답변 (1개)
Walter Roberson
2013년 4월 22일
if isempty(who('faultsActiveList', '-file', MATfile))
... not there ...
end
카테고리
도움말 센터 및 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!