Multi-Delimited file

I have data in xls files and one of the rows looks like this: 1/1/09 0:21 The first have represents date and the second have represents time. when imported using xlsread is get a long number which means nothing I need the date and the time. Can some one help me please.

2 comentarios

Paulo Silva
Paulo Silva el 5 de Mzo. de 2011
post the code you are using and someone might tell you what your should improve or change.
faisal Mahmood
faisal Mahmood el 5 de Mzo. de 2011
for i = 1:numberoffiles
A = 'Data';
str = sprintf('%d',i);
varname = [A,str];
filename = listing(i,:).name;
[ndata, text, alldata]= xlsread(filename);
end

Respuestas (1)

Walter Roberson
Walter Roberson el 5 de Mzo. de 2011

2 votos

datestr() that long number. But be sure to cross-check the result, as excel's time base is different than Matlab's. There is a relatively simple time conversion if needed. The offsets are documented here

2 comentarios

faisal Mahmood
faisal Mahmood el 5 de Mzo. de 2011
what about if its in the middle of the file. Like it row number T.
Walter Roberson
Walter Roberson el 5 de Mzo. de 2011
Then datestr(ndata(T,C)) where C is the column number.

La pregunta está cerrada.

Preguntada:

el 5 de Mzo. de 2011

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by