assigning data which include global and string into edit in GUI.

1 view (last 30 days)
a=125;
b=sprintf('latitude %13.7f degree \n', a)
% b=latitude 125.0000000 degree
%I wanna assign this created structure (latitude 125.0000000 degree) into edit in GUI environment as they appear.
  3 Comments
Jan
Jan on 18 Jun 2013
I agree that this is a certain kind of "structure", but the term is really misleading here, and "string" would be much more helpful and descriptive.

Sign in to comment.

Accepted Answer

Jan
Jan on 18 Jun 2013
a = 125;
b = sprintf('latitude %13.7f degree \n', a);
figure;
EditH = uicontrol('Style', 'edit', 'String', b);
  7 Comments
sermet
sermet on 18 Jun 2013
I wrote the codes which is defining a and b. Please write following codes again taking into consideration a blank edit field in GUI for write this string. So I can copy these codes.
a=125
b = sprintf('latitude %13.7f degree \n', a)
......
.....
Jan
Jan on 19 Jun 2013
Edited: Jan on 19 Jun 2013
Is this meant seriously or are you kidding?
I have written:
set(handles.EditHandle, 'String', b);
and explained:
with a matching name instead of "EditHandle". Perhaps it is "handles.edit1"
So try to replace "handles.EditHandle" by "handles.edit1". I will definitely not do this trivial replacement for you.

Sign in to comment.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!