read matrix from .txt

1 visualización (últimos 30 días)
lucas
lucas el 20 de Oct. de 2013
Comentada: lucas el 20 de Oct. de 2013
hello, can anyone tell me what do i have to do to read this matrix saved on a.txt file?
1 2 3 4
5 6 7 8
9 10 11 12
thx :)

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 20 de Oct. de 2013
M=dlmread('filename.txt')
  12 comentarios
Cedric
Cedric el 20 de Oct. de 2013
Editada: Cedric el 20 de Oct. de 2013
Ok, there are special characters in your file, so the issue is probably the way you saved it with Excel. Try exporting the Excel file as CSV (Comma Separated Values) even if you name the file with a .txt extension.
lucas
lucas el 20 de Oct. de 2013
thx mate!! works fine now with that comma thing :)

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by