Why is UserData preferred over guidata
Mostrar comentarios más antiguos
Storing app data in the UserData property of the main app figure is recommended over using guidata, because it can result in more readable code. For more information about storing and sharing app data, see Share Data Among Callbacks.
I do not understand why UserData results in more readable code. For example, extracting data from the UI in a callback is with guidata:
data = guidata(gobject);
and with UserData:
data = ancestor(gobject, "figure", "toplevel").UserData
What are the benefits of UserData over guidata and does it matter which one you use?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Structures en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!