- 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.
조회 수: 3 (최근 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!