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

조회 수: 29 (최근 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 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