Sort depends on value with cellfun
Afficher commentaires plus anciens
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));
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Cell Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!