- I do not understand how the file is chosen for the second column. Is it the most recent file before the target point? If so then does that imply that the same content could be repeated, if there was a gap in files so that the same file was the most recent compared to several of the dates?
- You say that you want the contents from the mentioned .mat file, but you want to put them into a column. Your first column is numeric; to get the contents of the .mat file then each element of the second column would have to be a struct with one field for each variable in the file. Is the overall output to be a cell array? Is it to be a table() ?
load several .mat Files in For-Loop for several dates with one condition.
2 ビュー (過去 30 日間)
古いコメントを表示
i have one mat file which contains 80 rows in 'yyyymmdd' format. i have another folder with 238 mat files with same 'yyyymmdd' as mat file names. i want to load contents from the folder mat file to the first mat file where the date from the folder is less than the date of the first mat file.
eg.
mat file which has 80 rows
19900102
19900301
19900603
19900903
19901202
19900303
........ up to
20080901.
next i have folder of 238 .mat files with following names
19891231.mat
19900131.mat
19900228.mat
19900328.mat
19900430.mat
.....up to
20080930.mat
so i want output as 2 columns
column1(which has 80 rows) column2(contents from the below mentioned mat file)
19900102 19891231.mat
19900301 19900131.mat
19900228.mat
19900328.mat
the condition is if we look at second row date is 19900301 i need contents of 19900228.mat file not 19900131 or 19900328 likewise i need for all 80 rows.
Thanks in Advance!!!
2 件のコメント
Walter Roberson
2021 年 10 月 28 日
I do not understand what is being asked for.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で File Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!