필터 지우기
필터 지우기

using the Xlsread functon

조회 수: 1 (최근 30일)
Ahmed BOULMANE
Ahmed BOULMANE 2015년 7월 15일
댓글: Ahmed BOULMANE 2015년 7월 15일
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
Ahmed BOULMANE
Ahmed BOULMANE 2015년 7월 15일
i want to use it to build a file name: using that : name = ['txt file\',FileName,'.txt']
Ahmed BOULMANE
Ahmed BOULMANE 2015년 7월 15일
So I need another function that can give me the possibility to use the texts that I recovers from the excel file as normal texts

댓글을 달려면 로그인하십시오.

채택된 답변

Brendan Hamm
Brendan Hamm 2015년 7월 15일
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
Brendan Hamm
Brendan Hamm 2015년 7월 15일
Sorry, almost missed the fact that:
txt(indice,1)='xxxxxxxxxxxxx'
is an invalid statement. You need curly brackets here too.
txt{indice,1}='xxxxxxxxxxxxx'
Ahmed BOULMANE
Ahmed BOULMANE 2015년 7월 15일
thank You :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by