How to combine the text from two edit text and making it as one text?

Hi team,
I have two text from two separate edit text and i want to represent them as single text in code. My code is as below.
X=char(get(handles.editX,'string'));
Y=char(get(handles.editSNo,'string'));
keyword in folderlist below should be combination of X and Y.
folderlist=dir(fullfile(folderpath,keyword));
Tried in all possible ways, not able to solve, please someone help solving this.

 채택된 답변

Wayne King
Wayne King 2013년 12월 24일
Can you show us what your output X and Y look like?
Have you tried strcat()?
X = 'C:\temp';
Y = 'data'
strcat(X,'\',Y)
% or
keyword = 'test.txt';
X = 'C:\temp'
fullfile(X,Y,keyword)

댓글 수: 1

Radhika
Radhika 2013년 12월 26일
편집: Radhika 2013년 12월 26일
X=TR-13-01639(16)
Y=102489473-16*
when i write keyword it has to be TR-13-01639-102489473-16*

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

추가 답변 (1개)

Wayne King
Wayne King 2013년 12월 26일
X= 'TR-13-01639(16)';
Y = '102489473-16*';
idx = find(X=='(');
X(idx:end) = [];
keyword = strcat(X,'-',Y)

카테고리

도움말 센터File Exchange에서 Cell Arrays에 대해 자세히 알아보기

태그

질문:

2013년 12월 24일

댓글:

2013년 12월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by