Sort depends on value with cellfun
Ältere Kommentare anzeigen
Hello,
I would like to sort my JSON data order by "createdAt" column.
But it gives an error "Index exceeds the number of array elements (1)."
data = loadjson('C:/data/default.json');
[~,X] = sort(cellfun(@(cellElem) cellElem.createdAt, data.Location,'UniformOutput',false));
data = data(X);
count_data = sum(cellfun(@(x) numel(x), data.Location));
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Cell Arrays 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!