Dir function used for batch reading in MATLAB

Source: Internet
Author: User
MATLAB uses the Dir function to obtain all subfolders and files in the specified folder and store them in an array of object structures.

The dir function can be called.
Dir ('.') lists all subfolders and files in the current directory
Dir ('G: \ MATLAB ') lists all subfolders and files in the specified directory
Dir ('*. M') lists the folders and files in the current directory that match the regular expression.

The result is that each element in the struct array is a struct in the following format.
Name -- filename
Date -- modification date
Bytes -- number of bytes allocated to the file
Isdir -- 1 If name is a directory and 0 if not
Datenum -- modification date as a MATLAB serial date number
They are the file name, modification date, size, whether it is a directory, and the specific modification date of Matlab.

The file name can be extracted for reading and saving.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.