プロットを作成する必要があるかどうかを示すヒートマップへの文書化されていない 2 番目の入力と、作成された図へのハンドルを取得するためのいくつかの他のハンドル グラフィックス トリックを使用する必要があります。何かのようなもの
data = rand(20,20,10); % create test data
hmo = HeatMap(data(:,:,1),false); % create but do not plot
plot(hmo); % do the plot
allHFig = findall(0,'Type','figure'); % get handle to all open figures
hFig = allHFig(1); % we want the most recently created figure
for idx = 2:size(data,3)
hmo = HeatMap(data(:,:,idx),false); % create heatmap but do not plot
plot(hmo,hFig); % plot to our existing figure
pause(0.5);
end