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.

 Respuesta aceptada

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 comentario

Radhika
Radhika el 26 de Dic. de 2013
Editada: Radhika el 26 de Dic. de 2013
X=TR-13-01639(16)
Y=102489473-16*
when i write keyword it has to be TR-13-01639-102489473-16*

Iniciar sesión para comentar.

Más respuestas (1)

X= 'TR-13-01639(16)';
Y = '102489473-16*';
idx = find(X=='(');
X(idx:end) = [];
keyword = strcat(X,'-',Y)

Categorías

Etiquetas

Preguntada:

el 24 de Dic. de 2013

Comentada:

el 27 de Dic. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by