How do I determine the most recently updated file in a folder in MATLAB?

36 ビュー (過去 30 日間)
I need to load the latest file in a directory into the MATLAB workspace, but I do not know how to determine the most recently updated file.

採用された回答

MathWorks Support Team
MathWorks Support Team 2009 年 12 月 1 日
This functionality does not come built-in with MATLAB.
However, this is easy enough to do with a custom function. As an example, use the attached MATLAB function file "getlatestfile.m". This function accepts the full directory path as the input and returns the most recent file in that directory.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by