Two mat files inside one mat file

2 ビュー (過去 30 日間)
Nalini Nadupalli
Nalini Nadupalli 2015 年 10 月 26 日
コメント済み: Nalini Nadupalli 2015 年 10 月 26 日
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?
  1 件のコメント
Nalini Nadupalli
Nalini Nadupalli 2015 年 10 月 26 日
Yes I understand. Thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by