I have the code below but when I run, I get a textscan error. I am not sure what else I can try....I know that my text file is in my current MATLAB folder so the path should be okay...
ExPath = [pwd,'/watershed.txt'];
fid=fopen(ExPath)
data = textscan(fid,'%d %d %d %f %f %f %f %f', 'headerlines',1);
Error using textscan
Invalid file identifier. Use fopen to generate a valid file identifier.

回答 (1 件)

Star Strider
Star Strider 2021 年 4 月 28 日

0 投票

Use the fullfile function to build the complete path.

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

タグ

質問済み:

2021 年 4 月 27 日

回答済み:

2021 年 4 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by