How to check exist by function if a particular file to another folder in the directory ?

2 Ansichten (letzte 30 Tage)
Hello,
I would like to know how you could use the exist function to check whether a particular file in another folder or directory because of the way I do it gives me error and do not know if I 'm doing it right ... I could you help ?
matlab_dir = [ pwd filesep ] ;
cp = [ matlab_dir 'lib / '] ; % lib is the folder where the .wav files that I want to see if there are .
exist ( { [ cp ' example.wav '] , matlab_dir } )
thanks in advanced!
Undefined function ' exist ' for input arguments of type ' cell' .
  1 Kommentar
Karan Gill
Karan Gill am 6 Jul. 2016
Bearbeitet: Karan Gill am 6 Jul. 2016
The curly brackets {} convert your input to a cell array. exist does not accept cell array input so you get an error. Instead, follow the syntax on the doc page: http://www.mathworks.com/help/matlab/ref/exist.html .

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by