In mathematical modeling, excel is often used to save data, and it's also necessary to import data into matlab.
1. Fi & t read excel tables; to use the xlsread function, the return value of xlsread has three forms.

 NUMERIC = xlsread(FILE);



Numeric is the returned data, and txt is the returned character, and raw is the entire table.
Where the input parameter is the following form, file is the file name, sheet is the name of the worksheet, and range is range.


Specific examples are as follows


Sometimes because the number is too large, matlab automatically converts to exponential display, which will lose progress, so you can use the following command to

format long g

In some cases, you need to write data to excel tables to use the xlswrite function, as follows


Fn is the file name, and s is the data that's needed to save, and sheet3 is the name of the worksheet to save, and"a1"is the starting position.

Copyright © 2011 Dowemo All rights reserved.    Creative Commons   AboutUs