Store Data in UserData or Other Object Properties
UI components contain useful information in their properties, which you can access directly as long as you have access to the component. Use dot notation, component.property, to store or retrieve a component property. Dot notation works in R2014b and later releases. If you are using an earlier release, use the get and set functions instead.