Two mat files inside one mat file

2 Ansichten (letzte 30 Tage)
Nalini Nadupalli
Nalini Nadupalli am 26 Okt. 2015
Kommentiert: Nalini Nadupalli am 26 Okt. 2015
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.

Akzeptierte Antwort

Image Analyst
Image Analyst am 26 Okt. 2015
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?

Weitere Antworten (0)

Kategorien

Mehr zu Tables finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by