How do I use the ismember function (if possible) to locate the min/max GMT time elements within a cell array?
Ältere Kommentare anzeigen
I have the following 5x4 cell array;
z = { '21:48:50.53' 78530.5390000000 2 580;
'21:48:51.28' 78531.2890000000 4 581;
'21:48:52.03' 78532.0390000000 0 4;
'21:48:52.80' 78532.8050000000 0 4;
'21:48:53.55' 78533.5550000000 1 4};
I am attempting to create a subset of data (A) based on the values in column 4 using the following;
A = z(ismember(z(:, 4), [4]), :);
with the intent of attaining the minimum and maximum values in column 1 (GMT Time).
So using the above cell array, the minimum (earliest) time would be 21:48:52.03 and the maximum (latest) time would be 21:48:53.55.
However, when I attempt to create the subset of data, I get the following error message;
??? Error using ==> cell.ismember at 28 Input must be cell arrays of strings.
Error in ==> GMT_Time_Extraction at 10 A = a(ismember(a(:, 4), [4]), :);
I suspect the problem rests in the GMT times in column 1 or the way I’m attempting to use the ismember function. But in reading the documentation I’m not sure what I’m missing.
Any suggestions are greatly appreciated.
Thank you.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Time Series Objects finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!