read matrix from .txt

4 次查看(过去 30 天)
lucas
lucas 2013-10-20
评论: lucas 2013-10-20
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 :)

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2013-10-20
M=dlmread('filename.txt')
  12 个评论
Cedric
Cedric 2013-10-20
编辑:Cedric 2013-10-20
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 2013-10-20
thx mate!! works fine now with that comma thing :)

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by