Cell and double data
Ältere Kommentare anzeigen
Hello,
I have an excel file something like this:
Type Value
Type A 100
Type A 500
Type B 1000
I use xlsread to import data to matlab and i get two data types:
double
100
500
1000
and cell
Type Value
Type A
Type A
Type B
I need to read the "column Type" and then sum the "column Value", if the type is the same . The goal is to get something like this and than export to excel:
Type Value
Type A 600
Type B 1000
Can you help me?
Thanks.
Joao Rosa
Akzeptierte Antwort
Weitere Antworten (1)
the cyclist
am 10 Dez. 2011
0 Stimmen
You could use the ismember command on the first column of the cell, to find indices to each unique value.
Then, for each value, sum over its indices.
Then use xlswrite to write back to Excel.
Kategorien
Mehr zu Spreadsheets finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!