Uploading multiple matfiles from same folder.

1 回表示 (過去 30 日間)
Muhammad Haziq
Muhammad Haziq 2019 年 5 月 22 日
コメント済み: Muhammad Haziq 2019 年 5 月 23 日
Hi,
I want to upload multiple .mat files from a folder and want to save their data in variables. can any body guide me how can I do that. The initial names of the .mat files are different but last name is same.
  1 件のコメント
Luis J Gilarranz
Luis J Gilarranz 2019 年 5 月 22 日
Is there any pattern in the names? Could you edit the question with 5 file names or so?

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

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 5 月 22 日
編集済み: KALYAN ACHARJYA 2019 年 5 月 22 日
Make folder as currnt working directory
list=dir('*.mat');
for j=1:length(list)
matfile=load(list(j).name);
% do operation....one and next loop iterattion it load other
end
or if you want to load all mat files as cell array
use
matfile{j}=load(list(j).name);
  1 件のコメント
Muhammad Haziq
Muhammad Haziq 2019 年 5 月 23 日
Thanks, it work well

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by