Found the solution. Change the GUI callback function to read as follows:
function GUIButtonGroupSelectionChanged(app, event) % or whatever your GUI is named
global AzEl_mode;
AzEl_mode = get(event.NewValue, 'Tag' );
end
Then in the parent class where the component is initialized, add the following function:
function GUIButtonPushed(~,~)
GUIPanel = GUI; % instantiate the GUI
global AzEl_mode;
if (AzEl_mode == 1)
GUIPanel.AZELButton.Value = true; % your button names may vary
elseif (AzEl_mode == 2)
GUIPanel.AZELButton.Value = true;
end
end
Note that there is no need to include the "AzEL_mode == 0" case, because the GUI already defaults to 0 when it is initialized.
Pulldown menus can be handled the same way, except the Value is set to one of the drop-down item values, as follows:
global scan_mode_index
if (scan_mode_index == 1)
GUIPanel.Dropdown.Value = 'Notary Sojak'
where the global scan_mode_index was saved in the callback function.
There may be better methods that don't require the use of globals, but this works for me.