I don't really understand why you would want to do this, but here you go:
Updated
function moveFigureElegantly
hFig1 = figure;
set(hFig1,'units','normalized');
plot(1:10);
hFig2 = figure;
surf(peaks);
trajectory = [sin(linspace(0,2*pi,100)).', cos(linspace(0,2*pi,100)).']./2+0.25;
ii = 0;
T = timer('Period',0.5,...
'ExecutionMode','fixedRate',...
'BusyMode','drop',...
'TasksToExecute',200,...
'StartDelay',0,...
'TimerFcn',@moveFig,...
'StartFcn',[],...
'StopFcn',[],...
'ErrorFcn',[]);
start(T);
function moveFig(~,~)
ii = ii+1;
set(hFig1,'position',[trajectory(ii,:), 0.5 0.5])
if ii == size(trajectory,1)
ii = 0;
end
end
end
Best Answer