如何加载具有可变文件名的.mat文件? [英] How to load .mat file which has a variable filename?

查看:90
本文介绍了如何加载具有可变文件名的.mat文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

%select all .mat files

oar = dir('*oar.mat'); n = {oar.name};

%loop through files

for l=1:length(oar);

load pat_oar(l) %<---this is the .mat file with variable filename


clear ...

end

我如何编写一些Matlab脚本,该脚本将在一个.mat文件中依次读取...

How do I write some Matlab script that will read in one .mat file after another...

推荐答案

您的文件名存储在n中,因此您应该可以:

You file names are stored in n, so you should be able to do:

for l=1:length(oar)
    load(n{l})
end

这篇关于如何加载具有可变文件名的.mat文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆