GUI Edit Text
2 views (last 30 days)
Show older comments
How to make string in edit_text1 from edit_text2 exp : In edit_text1 : 123456789 In edit_text2 : 123
3 Comments
Image Analyst
on 11 Apr 2012
Yeah, it wouldn't if your "tag" for the edit text control was edit_text1 like you said first.
Accepted Answer
Image Analyst
on 11 Apr 2012
% 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.
3 Comments
Image Analyst
on 11 Apr 2012
Then show YOUR code because you did not run any of our code. You probably misspelled something, or are using different names for your controls and didn't modify our code to reflect that, or somehow otherwise changed things. Why don't you tell us the actual error message? Copy and paste all of the red error text that you see in the command window.
More Answers (1)
See Also
Categories
Find more on Text Data Preparation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!