How to read an excel spreadsheet ignoring text and comments

i'm working on a matlab app that read an excel file to get experimental data, the files i need to read have a lot of comments and text over the data, i would like to know if is possible to read a file in the same way matlab import data but by coding, detecting the columns with data and ignoring text, this is an example of the files i need to read.
question.jpg

Answers (1)

The venerable xlsread will return numeric, text, and the raw data in separate locations.
Probably better is to use the detectImportOptions utility function and then its output to read the data as a table instead.
It would be far easier if you would attach a sample file; my eyes can't begin to even read the image plus there's nothing that can be done with it....

5 Comments

Did you try the suggestion yet?
yes, the detectImportOptions utility work perfectly i only specified the range where the data is and that's it, thank you
It can probably detect that for you automagically as well...
Jorge, try his suggestion:
[numbersOnly, stringsOnly, everything] = xlsread('HPPC_18650_29dnl.xlsx');
If you look at numbersOnly, you will see it is an array where the (1,1) element is the row with the topmost number and leftmost number. Any place in that range that is a string or blank will show up as a NAN. If you have several ranges of numbers, you'll have to extract those individually from the larger matrix. Note that the indexes don't necessarily match up with the same row and column in Excel.

Sign in to comment.

Products

Release

R2018b

Asked:

on 27 Nov 2019

Commented:

on 28 Nov 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!