How to make matlab access two folders for data when separated by date
1 回表示 (過去 30 日間)
I'm trying to move some of the older data into a new folder (ex: move pre2020 files from folder_new to folder_old, and leave the 2020~ files in the folder_new).
Problem is that there are some functions where the user needs to analyze files in both folders (ex: data from Dec 2019 to Feb 2020)
How should I proceed with this?
I was thinking about using an if statement, but not sure how to make matlab look at both folders when a function needs data from both folder_new and folder_old.
Folder structure is via
回答 (1 件)
Benjamin Thompson 2022 年 7 月 1 日
編集済み: Benjamin Thompson 2022 年 7 月 1 日
You can get file dates using the "dir" function or keyword in MATLAB. Does any of this help?
>> D = dir
105×1 struct array with fields:
>> datetime(D(1).date) > datetime(2020, 1, 1)
>> datetime(D(1).date) > datetime(2022, 6, 18)