필터 지우기
필터 지우기

How can I read text file in MATLAB? (files include text)

조회 수: 2 (최근 30일)
Kyungsun Ha
Kyungsun Ha 2017년 6월 29일
댓글: Walter Roberson 2017년 6월 29일
Greetings.
Actually, I want to read text file. but, when I write like
fopen('pathway\[AM] Ch1 (28-Jun-2017 16-53-20).txt')
this, ans(file ID) is -1.
So I go to folder where txt file located directly, but It cannot run function because function in the MATLAB folder(My Documents).
How can I read text file without folder movement?

답변 (1개)

Astik Sachan
Astik Sachan 2017년 6월 29일
편집: Walter Roberson 2017년 6월 29일
  1. Add Folder where your ".txt" file is to path of matlab.
  2. Or you can use absolute path to the text file to read it.
  댓글 수: 1
Walter Roberson
Walter Roberson 2017년 6월 29일
You can use fullfile() to help construct absolute paths.

댓글을 달려면 로그인하십시오.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!