how to read a text file using dlmread that is not in matlab directory?
조회 수: 26 (최근 30일)
이전 댓글 표시
Hi there... how to solve this error "Error using dlmread (line 122) The file 'an.text' could not be opened because: No such file or directory", as my file is located at desktop in text format. kidnly help me out to read data in this file. thanks in advance
댓글 수: 0
채택된 답변
Ameer Hamza
2018년 8월 11일
If it is not on MATLAB path, you can still read it by specifying the correct Absolute or relative paths. For example, the following uses an absolute path
dlmread('C:\{path_to_folder}\ann.txt')
Where 'C:' is the drive in which folder is located. Similarly, on Mac or Linux, you will need respective absolute paths.
댓글 수: 8
Ameer Hamza
2018년 8월 11일
dlmread() can't read non-numeric data. In your file, the first column contains dates. For you case, more appropriate is
data = readtable('an.txt')
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Search Path에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!