Sort Cell Array Data
Mostrar comentarios más antiguos
clear all
close
F = xlsread('C:\Users\katie\Desktop\matlabhelp.csv')
t = F(:,1);
time = x2mdate(t,0);
date =datestr(time);
A = [date, F(:,2), F(:,3)];
dn = cellfun(@(x) datenum(x(1:11), 'dd-mmm-yyyy'), A);
[dns,ix] = sort(dn);
FinalSorted = A(ix);
An error occurs saying the following:
Error using cellfun
Input #2 expected to be a cell array,
was char instead.
Error in rough (line 12)
dn = cellfun(@(x) datenum(x(1:11),
'dd-mmm-yyyy'), A);
(Please note data is a small sample)
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Preprocessing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!