MATLAB: Using the Xlsread functon

excel

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

Best Answer

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']