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 Center および File Exchange로우 레벨 파일 I/O についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!