Xlsread command in Matlab
1 次查看(过去 30 天)
显示 更早的评论
How Can I extract each columns with the xlsread command.
for i1 = 2:n1+1
matrix = xlsread();
end
0 个评论
采纳的回答
Mischa Kim
2014-2-21
编辑:Mischa Kim
2014-2-21
Francesco, with xlsread you read the entire spreadsheet. Which means, that you can read an entire matrix as is, at once. E.g., from the MathWorks documentation:
values = {1, 2, 3; 4, 5, 6; 7, 8, 9}; % write matrix to .xlsx file
headers = {'First','Second','Third'};
xlswrite('myExample.xlsx', [headers; values]);
and then
filename = 'myExample.xlsx'; % read matrix from file
A = xlsread(filename)
1 2 3
4 5 6
7 8 9
as expected, A is read as a 3-by-3 matrix.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!