Filesep error Unexpected Matlab expression

1 回表示 (過去 30 日間)
Nicola
Nicola 2014 年 2 月 22 日
コメント済み: Nicola 2014 年 2 月 22 日
Good morning,
i'm creating a script which will work on Unix and Windows so i need to solve the problem of different directory mode / \; i read i have to use filesep but matlab gives me error
I wrote
delete('Risultatigiorno' filesep '*.txt');
Unexpected MATLAB expression. Why?
I have another question, if i write
pathout='Risultatigiorno' filesep;
is it right? Thank you

採用された回答

Star Strider
Star Strider 2014 年 2 月 22 日
Use square brackets to contatanate text :
delete(['Risultatigiorno' filesep '*.txt'])
That should work.
(I don’t understand why you have the asterisk ( * ) before ‘.txt’ though. I’m not sure that works in Windows/MSDOS computers.)
  1 件のコメント
Nicola
Nicola 2014 年 2 月 22 日
  • because i want to delete all txt file

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

Translated by