How to send data in edit box to different fig. window.
Ältere Kommentare anzeigen
Hi,
I like to send a value of editbox in A fig. to B. fig. With the value, I like to set max of a slider.
I successed this in the same figure window, but failed in differents figure windows.
if anyone know, please let me know.
Thansk.
1 Kommentar
Samuel
am 20 Feb. 2011
Akzeptierte Antwort
Weitere Antworten (3)
Samuel
am 20 Feb. 2011
0 Stimmen
2 Kommentare
Paulo Silva
am 20 Feb. 2011
doc figure
You will find this:
figure(h) does one of two things, depending on whether or not a figure with handle h exists. If h is the handle to an existing figure, figure(h) makes the figure identified by h the current figure, makes it visible, and raises it above all other figures on the screen. The current figure is the target for graphics output. If h is not the handle to an existing figure, but is an integer, figure(h) creates a figure and assigns it the handle h. figure(h) where h is not the handle to a figure, and is not an integer, is an error.
h = figure(...) returns the handle to the figure object.
Walter Roberson
am 20 Feb. 2011
Questions about "new" figure window and "current" window cannot be answered without more context.
I used explicit figure numbers to show that the code was not restricted to dealing with the "current figure" and "another figure". On only restriction in the first example is that the slider handle needs to be created before it can be referred to in the callback for the edit box. The callback could, however, be set() after the slider had been created.
Samuel
am 20 Feb. 2011
0 Stimmen
3 Kommentare
Walter Roberson
am 20 Feb. 2011
Well, if correcting your existing line of code is a "simple example:
RBslider = findall(0,'type','uicontrol','tag','RBslider');
As I indicated, there is no type 'slider', only 'style' slider.
Samuel
am 20 Feb. 2011
Walter Roberson
am 21 Feb. 2011
Finding by Tag is generally considered acceptable for unique items.
Personally I consider it to be on par with global variables... though I don't dislike global variables as much as most people do.
Samuel
am 20 Feb. 2011
0 Stimmen
1 Kommentar
Walter Roberson
am 20 Feb. 2011
You will want to use an explicit Position for your uicontrol() calls.
There is nothing obviously wrong with the code you show, but you do not show the edit box or the callback of the edit box that should cause the new slider value to be set.
Kategorien
Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!