Cell to String
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I am trying to concatenate a two strings in the below code:
baseDIR = 'C\Documents and Settings\User\Desktop\';
tstFeats = {'PostEq', 'AEC'};
refDir = strcat(baseDIR, tstFeats);
fileList = dir([refDir '\*.wav']);
the command dir does not work on input of type cell. I would like to convert the type cell to string to enable the working of the above code.
If I replace tstFeats = {...} with tstFeats = [...], the code works fine. But all elements in the second case need to be of the same length if I need to make a column vector.
Any help is appreciated.
Thank you.
0 commentaires
Réponses (1)
Walter Roberson
le 7 Mar 2012
There does not seem to be much point in this, as dir() can only accept a single specification per call.
Please also recall that the structure of information returned by dir() does not indicate the directory anywhere, so if you did somehow manage to get dir() to look in two directories on the same call, you would not be able to tell which directory any particular returned file name had come from.
2 commentaires
Voir également
Catégories
En savoir plus sur File Operations 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!