MATLAB: GUI Edit Text

edit text

How to make string in edit_text1 from edit_text2 exp : In edit_text1 : 123456789 In edit_text2 : 123

Best Answer

% Get the string in the control called handles.edit_text1.
string1 = get(handles.edit_text1, 'String');
% Extract just a portion of it.
string2 = string1(1:3); % Or whatever you want to start and stop at.
% Send that string2 to the control called handles.edit_text2.
set(handles.edit_text2, 'String', string2);
drawnow; % If needed, like you're in an intensive loop.