How to read an excel spreadsheet ignoring text and comments
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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.

0 Kommentare
Antworten (1)
dpb
am 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 Kommentare
Image Analyst
am 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.
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!