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
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 CenterFile Exchange 中查找有关 File Operations 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by