Sort depends on value with cellfun
Mostrar comentarios más antiguos
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));
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Cell Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!