MATLAB读取excel中的数据
读取sheet1中的数据
![](https://img2020.cnblogs.com/blog/1951423/202007/1951423-20200729121814551-2124085611.png)
-
[num,txt,raw]=xlsread('C:UsersAdministratorDesktop esta.xls')
-
%num返回的是excel中的数据,txt输出的是文本内容,raw输出的是未处理数据
-
%一般情况下,我们读取的是excel中的数据,所以可以直接用下面的,只输出数据矩阵便可
-
[num]=xlsread('C:UsersAdministratorDesktop esta.xls')
eg: [data,text] = xlsread('H:张教师研究项目不同波导尺寸下,不同slot横向狭缝参数s1s2 000_700_450bc(10,10,200).xlsx',1,'A5:H25');
读取指定sheet中的数据
如果想读取excel中的第二个sheet中的数据,可以输入下面命令
[num]=xlsread('C:UsersAdministratorDesktop esta.xls',2)
![](https://img2020.cnblogs.com/blog/1951423/202007/1951423-20200729121951767-1014502785.png)
![](https://img2020.cnblogs.com/blog/1951423/202007/1951423-20200729122015276-793872908.png)
读取指定单元格中的数据
[num]=xlsread('C:UsersAdministratorDesktop esta.xls',2,'A2:C5')
![](https://img2020.cnblogs.com/blog/1951423/202007/1951423-20200729122032435-882481525.png)
参考网址:https://blog.csdn.net/qq_38826019/article/details/81184811