Import data in MATLAB: ImportData function

Source: Internet
Author: User

Importing mat files with the load function everyone will. But today I get a data that the file suffix is '. Data '. How should I read it?

I only use the Matlab interface workspace the region's "Import data" button to manually import the file. Well, fortunately, it succeeded. By the way, this "Import data" button is very powerful, and even Excel files can be imported.

But how do you suppose to import such a non-mat file in a script?

This is the "ImportData" Function!

---------------------------------------------------------------------

ImportData

Load data from File
Syntax

ImportData (filename)
A = importdata (filename)
A = importdata (filename, delimiter)
A = importdata (filename, delimiter, nheaderlines)
[A, delimiter] = ImportData (...)
[A, delimiter, nheaderlines] = ImportData (...)
[...] = ImportData ('-pastespecial ', ...)
Description

ImportData (filename) loads data from filename to the workspace.

A = importdata (filename) loads data into A.

A = importdata (filename, delimiter) interprets delimiter as the column separator in ASCII file filename.

A = importdata (filename, delimiter, nheaderlines) loads data from the ASCII file filename, reading numeric data starting from Line nheaderlines+1.

[A, delimiter] = ImportData (...) returns the detected delimiter character for the input ASCII file.

[A, delimiter, nheaderlines] = ImportData (...) returns the detected number of the header lines in the input ASCII file.

[...] = ImportData ('-pastespecial ', ...) loads data from the system Clipboard rather than from a file.

----------------------------------------------------------------

The file formats that this function can support are: Mat file, ASCII files and spreadsheets,images, Audio files

This ASCII files and spreadsheets refers to: for ASCII files, data contains a double array. Other fields contain cell arrays.
For spreadsheets, each field contains a struct, with one field for each worksheet.

Import data in MATLAB: ImportData function

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.