extracting rows based on string in first column (Should be fairly simple ... not for me apparently)
Ältere Kommentare anzeigen
Hey everyone,
I have a large cell array with 8 columns (8758 x 8 cell). The first containing time in the string format of '2010-01-01 00:00'. I am trying to extract all the rows where the timestamp is '01' at the 9th and 10th characters.
I know this is relatively basic but cannot get the indexing right. I had this so far:
rows = find(a{:,1}(9,10) == '01')
extrdata = a{rows,1};
I have also tried the following but get the following error:
>> a( a{:,1}(9:10) == '01' , : )
Bad cell reference operation.
If I were to index just for one row then it works but my indexing is wrong to work for all rows:
>> a{1,1}(9:10)
ans =
01
Thanks for any help!
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Dates and Time 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!