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

2 visualizaciones (últimos 30 días)
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 comentario
Karan Gill
Karan Gill el 6 de Jul. de 2016
Editada: Karan Gill el 6 de Jul. de 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 .

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by