How to replace multiple xlsread commands
2 次查看(过去 30 天)
显示 更早的评论
I have an older matlab code that reads multiple areas of a single excel sheet using multiple xls read commands. For example:
[NUM1 TXT1] = xlsread(myfile.xlsx,'Sheet1','A1:C10')
[NUM2,TXT2]= xlsread(myfile.xlsx,'Sheet1','Z200:AB500');
The data in the spreadsheet can be numerical or text, so having them split out like xlsread is handy for me (I use both the text and numerical data). I want to replace the multiple xls read commands with a single command to speed up the code, because the excel files are large and it takes a while to get all the data. I'm playing with a single readcell command and trying to get the data locations sorted out from the cell array but struggling with the multiple data types.
data=readcell(myfile.xlsx,'Sheet','Sheet1','Range','A1:AB500')
data1 = data(1:10,1:3)
Now data 1 is a cell array that contains A1:C10, but I need to get the numeric data and text data out of it in a way that replicates the [NUM1 TXT1] that I get from xlsread. Any ideas?
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!