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

1 visualizzazione (ultimi 30 giorni)
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 Commento
Karan Gill
Karan Gill il 6 Lug 2016
Modificato: Karan Gill il 6 Lug 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 .

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su File Operations in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by