How can I select numbers from excel to matlab?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I have an excel file with only 1 column and every cell results as follows:
'2019-10-12T02:41:27.091Z,1/0669958925:52238,-5.9858581261e-02,-1.7725070822e-04,+1.1940838453e-03'
In order to pass from excel to matlab i wrote the following:
[num,str]=xlsread('file1');
num is empty, str is a Nx1 cell. Each cell is a char like the following I wrote before.
How can I extrapolate the last 3 numbers and the date at the beginning of this char? Thank you for the help!
2 comentarios
Respuestas (1)
David Hill
el 20 de Abr. de 2021
str=readcell('test.xlsx');
%str={'2019-10-12T02:41:27.091Z,1/0669958925:52238,-5.9858581261e-02,-1.7725070822e-04,+1.1940838453e-03'}
for k=1:length(str)
T(1,:)=[regexp(str{k},'\d{4}[-]\d{2}[-]\d{2}','match'),regexp(str{k},'[+-]\d+[.]\d+[e][-]\d+','match')];
end
0 comentarios
Ver también
Categorías
Más información sobre Data Import from MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!