how get digits as in file?

1 visualización (últimos 30 días)
huda nawaf
huda nawaf el 10 de Oct. de 2011
hi, my data file (sample): 1 1800029049 12 5 1 1804857429 8 4 1 1800030906 13 5 1 1800018548 11 5 1 1800256362 9 4 1 1808438656 9 4 1 1807428619 5 3 1 1800373145 10 4
when I read it by this code: f=fopen('ws.data','r+'); b=fscanf(f,'%d'); fclose all
the result as: 1.0e+009 *
0.0000
1.8000
0.0000
0.0000
0.0000
1.8049
0.0000
0.0000
0.0000
1.8000
I want the digits as in file, how get that?
thanks

Respuesta aceptada

Daniel Shub
Daniel Shub el 10 de Oct. de 2011
sprintf('%d\n', x)
where x is your data.

Más respuestas (1)

Walter Roberson
Walter Roberson el 10 de Oct. de 2011
format long g
and then display your data.

Categorías

Más información sobre Data Import and Analysis en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by