why textscan did not work ?

hi, I have file as:
1488844,3,2005-09-06
822109,5,2005-05-13
885013,4,2005-10-19
I used textscan to get each column alone then I can deal with date to convert it , but no give what I need. thanks

1 comentario

Fangjun Jiang
Fangjun Jiang el 3 de Nov. de 2011
You've been here long enough to learn to use the {}Code format.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 3 de Nov. de 2011

0 votos

textscan(fid, '%f%f%s', 'Delimiter', ',')

3 comentarios

huda nawaf
huda nawaf el 3 de Nov. de 2011
thanks
i used:
fid = fopen('7.txt','r');
c=textscan(fid, '%f%f%s', 'Delimiter', ',')
I got:
c{1}
ans =
Empty matrix: 0-by-1
huda nawaf
huda nawaf el 3 de Nov. de 2011
sorry
it is working ,now, i did not do clear.
but please when i used
datenum(c{3})
I got
DATENUM failed.
Failed to parse date string.
Error using ==> datevec
2005 is too large to be a month.
Walter Roberson
Walter Roberson el 3 de Nov. de 2011
datenum(c{3},'yyyy-mm-dd')

Iniciar sesión para comentar.

Categorías

Etiquetas

Preguntada:

el 3 de Nov. de 2011

Community Treasure Hunt

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

Start Hunting!

Translated by