read matrix from .txt

조회 수: 1 (최근 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개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by