How do I import two ranges from the same column (from excel) into the same variable in matlab?
2 次查看(过去 30 天)
显示 更早的评论
Say I have column B with 100 elements, and i need the average of B1:B10 and B90:B100. What I tried so far is "vari= xlsread('file','B1:B10,B90:B100')", but it dont give me the right answer. And when I tried "vari= xlsread('file','B1:B10,B90:B100')",switching up the ranges, it gave me a different answer, one that was also not right. What am I doing wrong?
0 个评论
回答(1 个)
Walter Roberson
2015-12-5
You need to use two xlsread().
Alternately since 100 elements is not much, just read from the first desired to the last desired and then you can extract what you want.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!