Two mat files inside one mat file

2 次查看(过去 30 天)
I have one .mat file (eg: A) in my folder, however, when I double click it, it opens two .mat files in the workspace. I What is the data type of the actual .mat file A in the folder? Is it a struct?
Can .mat files belong to struct datatype? Please help -- I am confused. Thanks a lot for your help.

采纳的回答

Image Analyst
Image Analyst 2015-10-26
Using load() returns a structure where all the variables inside the mat file are fields of this structure. You can extract them into their own variable if you want.
% Create mat file with two variables in the single mat file.
save(filename, 'myVar', 'otherVar');
% Show workspace panel:
workspace
% Get rid of them so we can test the recall
clear('myVar', 'otherVar');
% Recall it.
storedStructure = load(filename)
myVar = storedStructure.myVar;
otherVar = storedStructure.otherVar;
Understand now?

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Tables 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by