Filesep error Unexpected Matlab expression

1 vue (au cours des 30 derniers jours)
Nicola
Nicola le 22 Fév 2014
Commenté : Nicola le 22 Fév 2014
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

Réponse acceptée

Star Strider
Star Strider le 22 Fév 2014
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 commentaire
Nicola
Nicola le 22 Fév 2014
  • because i want to delete all txt file

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur File Name Construction dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by