using the Xlsread functon
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Ahmed BOULMANE
le 15 Juil 2015
Commenté : Ahmed BOULMANE
le 15 Juil 2015
hello! i used the function xlsread to do that:
[num,txt]=xlsread(nameoffile,'C:C')
then
txt(indice,1)='xxxxxxxxxxxxx'
so, when i do that:
FileName =txt(indice,1)
==> the result is :
FileName= 'xxxxxxxxxxxx'
but me, i want to do that: FileName='xxxxxxxxxxxx' ==> FileName=xxxxxxxxxxxx in order to use FileName in my script
3 commentaires
Réponse acceptée
Brendan Hamm
le 15 Juil 2015
The issue is that txt is a cell array which contains char-arrays. So you need to use curly brackets to extract the character array back out.
FileName = txt{indice,1} % Curly Brackets!
name = ['txt file\',FileName,'.txt']
2 commentaires
Brendan Hamm
le 15 Juil 2015
Sorry, almost missed the fact that:
txt(indice,1)='xxxxxxxxxxxxx'
is an invalid statement. You need curly brackets here too.
txt{indice,1}='xxxxxxxxxxxxx'
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Import from MATLAB 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!