Sort depends on value with cellfun
显示 更早的评论
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));
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!