How to read an excel spreadsheet ignoring text and comments

12 visualizzazioni (ultimi 30 giorni)
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

Risposte (1)

dpb
dpb il 27 Nov 2019
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 Commenti
dpb
dpb il 28 Nov 2019
It can probably detect that for you automagically as well...
Image Analyst
Image Analyst il 28 Nov 2019
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.

Accedi per commentare.

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by