How to read a .txt file into Matlab?
조회 수: 5 (최근 30일)
이전 댓글 표시
I'm trying to get Matlab to read a .txt file into a string. I'm using the function readfile and can't get it to work. I have a .txt file saved in the correct directory called "April.txt" and I'm trying to say readfile(April.txt) or readfile('April.txt') and neither works. The error messages are Undefined variable "April" or class "April.txt". and Undefined function 'readfile' for input arguments of type 'char'. respectively.
댓글 수: 0
채택된 답변
Jan
2016년 3월 3일
Not "readfile" but "fileread":
fileread('April.txt')
Or even better with an absolute path
fileread(fullfile(Folder, 'April.txt'))
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!