필터 지우기
필터 지우기

Filesep error Unexpected Matlab expression

조회 수: 2 (최근 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 CenterFile Exchange에서 File Name Construction에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by