フィルターのクリア

Loading multiple mat files with the same name from folder source

1 回表示 (過去 30 日間)
Denni Purcell
Denni Purcell 2018 年 1 月 15 日
回答済み: Image Analyst 2018 年 1 月 15 日
I would like to be able to load a mat file named 'Synergy' from a folder path, in this folder path there are multiple participants (which can vary) which have been separated into their participant number but all contain the 'Synergy.mat' file
For example the top folder path is : N:\Gait\Research\Current Projects\CP Hemi Synergy Analysis\Data test participants
participant 1's data is located here : N:\Gait\Research\Current Projects\CP Hemi Synergy Analysis\Data test participants\CP_Syn01
Similarly, Participant 2 here: N:\Gait\Research\Current Projects\CP Hemi Synergy Analysis\Data test participants\CP_Syn02
I would like this automated to call in the Synergy mat file for any number of participants located in this folder.
Please help

採用された回答

Image Analyst
Image Analyst 2018 年 1 月 15 日
See recursive file listing demo (attached) in my function, that works for old versions of MATLAB.

その他の回答 (1 件)

Greg
Greg 2018 年 1 月 15 日
The (relatively) new recursive dir is amazing.
mats = dir('N:\Gait\Research\Current Projects\CP Hemi Synergy Analysis\Data test participants\**\Synergy.mat');
  5 件のコメント
Greg
Greg 2018 年 1 月 15 日
編集済み: Greg 2018 年 1 月 15 日
Ahh, that's the relatively new part. Can only use dir recursively in R2016b+.
Your next best option is use a Windows system dir call, or download a recursive dir from file exchange.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by