How can I check the contents of a MAT-file in MATLAB without loading it?

前端 未结 2 440
失恋的感觉
失恋的感觉 2021-02-07 19:44

I have a large structure in a MAT-file. I want to check if a specific field is present in the structure without loading the MAT-file since the contents are very large a

2条回答
  •  暖寄归人
    2021-02-07 20:24

    To check the contents of a MAT file without loading it, use:

    vars = whos('-file','test.mat')
    ismember('fieldname', {vars.name})
    

提交回复
热议问题