MATLAB: Changing folder’s name from unknown name

folder name

I want to change folder's name, but the only thing I know about the folder that it's the latest folder created in the folder where it located. How can I do it?

Best Answer

  • d = dir;
    The above command returns a struct array which has a field called datenum. Each file in the current directory corresponds to an entry in the array. The latest file will have the largest datenum