uitabgroup のタブ選択を同期させる場合、uitabgroup の SelectionChangedFcn コールバックを使用します。それぞれの uitabgroup における選択中のタブを示す SelectedTab プロパティを更新します。
各プロパティの詳細については以下のヘルプドキュメントをご覧ください。
・ uitabgroup: SelectionChangedFcn コールバックhttps://jp.mathworks.com/help/matlab/ref/uitabgroup.html#mw_812524ee-1717-48b0-850a-6f1c1920751f
・uitabgroup: SelectedTab プロパティhttps://jp.mathworks.com/help/matlab/ref/matlab.ui.container.tabgroup.html?searchHighlight=tab%20selectedtab&s_tid=srchtitle_tab%20selectedtab_2#d123e1594887
以下に簡単な例を示します。
この例では、それぞれの uitabgroup に紐づくタブの Title は一致していることを想定し、同じ Title である uitab オブジェクトを findobj 関数を使って検出しています。
clear, close all
f = figure(1);
Gname = {'Group A', 'Group B'}; % タブ名
tabgp1 = uitabgroup(f,'Position',[.05 .05 .3 .8],'SelectionChangedFcn',@selectfun);
tab1_a = uitab(tabgp1,'Title',Gname{1});
tab1_b = uitab(tabgp1,'Title',Gname{2});
tabgp2 = uitabgroup(f,'Position',[.4 .05 .3 .8],'SelectionChangedFcn',@selectfun);
tab2_a = uitab(tabgp2,'Title',Gname{1});
tab2_b = uitab(tabgp2,'Title',Gname{2});
function selectfun(obj,evt)
% SelectionChangedFcn
h = findobj(obj.Parent,'Title',evt.NewValue.Title); % 同じTitleを持つ uitab の検出
for n = 1:length(h)
h(n).Parent.SelectedTab = h(n); % uitab を選択
end
end