Excel is a common office automation software, with many advantages, as a commonly used measurement software, with storage data convenient, practical advantages, but its matrix operation is not as powerful as MATLAB, the following introduction to import Excel data into Matlab
- The Excel table to be read first is placed under the current working path
- Command Window Input [Number,txt,raw]=xlsread (' file.xlsx ');
Note: The number in the above formula contains the data in File.xls, not the header, or Nan if a character with non-numeric characters is encountered;
TXT contains all non-numeric characters in the File.xls, including the table header, and the number is null;
Raw is stored in the raw data in File.xls, without any processing, and also with the header.
File is the name of the Excel table you want to read;
office2003 the Excel file type is File.xls
Input parameters. xls can not be written; output parameters can be default, only one parameter only takes a number, two characters;
Number, TXT, raw can be changed to another name;
Here's a chestnut:
We want to read the Excel table named Aa.xlsx in the current working directory:
Enter [Number,txt,raw]=xlsread (' aa.xlsx ') in command window or other code windows
And then there's the result:
Now we have the data we want to import in workspace.
How to read excel in MATLAB