Import data based on markers in Excel.
显示 更早的评论
I am importing data from Excel file into Matlab using the xlsread command. My Excel sheet has data in columns B, C, D and E. The column A has the 'markers' at two locations telling me the start and end of rows that I need to import. For example, A7 has a marker "Start Load" and A155 has a marker "Stop Load". The marker locations are not always fixed. Is there a way for Matlab to detect the location of these marker strings in column A and import only those rows?
Thanks in advance,
Joe
回答(1 个)
dpb
2018-6-18
0 个投票
Read the text data from the spreadsheet in column A and locate the two fields, then reread with the specified range thus computed.
Or, read the whole sheet and return the raw cell data and do the above from the in-memory cell array. Will be somewhat faster as xlsread is fairly slow and so calling it twice will be more overhead-intensive.
类别
在 帮助中心 和 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!