Open mat files

Hi I have 6 different mat files in the C directory of my PC, how can I open them through a for loop and use them as an input to some other function?
Thanks.

回答 (1 件)

Jan
Jan 2012 年 2 月 1 日

0 投票

It depends on the names of the files and the data they contain. Example:
for i = 1:6
name = sprintf('C:\file%d.mat', i);
data = load(name);
yourfunction(data.values);
end
But this is only a bold guess. Please explain any details, if you need a more exact explanation.

カテゴリ

ヘルプ センター および File ExchangeWorkspace Variables and MAT Files についてさらに検索

タグ

質問済み:

2012 年 2 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by