フィルターのクリア

how can I read file from a different directory

2 ビュー (過去 30 日間)
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2019 年 10 月 11 日
回答済み: per isakson 2019 年 10 月 11 日
the matlab script that I am running from is in directory "a" but the I need to read text file using "fileread" from an directory b in the script. How can I navigate from existing directory (running script) which is "a" to directory "b"?

採用された回答

per isakson
per isakson 2019 年 10 月 11 日
If you know the full directory name of 'b' use that, i.e
chr = fileread( fullfile( 'c:', 'full', 'directory', 'name', 'of', 'b', [ text_file_name, '.txt' ] ) );
This way you can read the file from anywhere

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFile Name Construction についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by