reference objects outside function workspace?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have a simulation. It is run by a timer; the time function notifies a bunch of objects of an event, and in their callback functions they update themselves and produce xml strings. I want to send all the xml to a socket in the same function that produces the xml. If i put the socket in the workspace and then these functions run, is there a way for them to use the socket even though it isn't in the scope of the function?
0 Commenti
Risposta accettata
Walter Roberson
il 12 Ago 2011
Yes. You could create an access method for it, or you could findobj() on it, or you could create a global variable, or you could use any of the techniques used to share data with graphic callbacks (see http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.3F)
or you could pass the object handle in to the timer callback, or ...
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Graphics Object Properties in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!