我將使用在the documentation上找到的示例電影。
假設有一串幀:
figure('Renderer','zbuffer')
Z = peaks;
surf(Z);
axis tight
set(gca,'NextPlot','replaceChildren');
% Preallocate the struct array for the struct returned by getframe
F(20) = struct('cdata',[],'colormap',[]);
% Record the movie
for j = 1:20
surf(.01+sin(2*pi*j/20)*Z,Z)
F(j) = getframe;
end
在的help movie
結束時,它說:
MOVIE(H,M,N,FPS,LOC)指定的位置來無論對象的「單位」屬性的值如何,相對於對象H的左下角和 像素播放電影 。 LOC = [X Y未使用未使用]。 LOC是一個四元素位置 矢量,其中僅使用X和Y座標(使用記錄的 的寬度和高度來播放電影 )。
因此,無法以比記錄的尺寸更大的尺寸顯示電影。你必須要炸掉像素使其顯示在大尺寸:
% blow up the pixels
newCdata = cellfun(@(x) x(...
repmat(1:size(x,1),N,1), ... % like kron, but then
repmat(1:size(x,2), N,1), :), ... % a bit faster, and suited
{F.cdata}, 'UniformOutput', false); % for 3D arrays
% assign all new data back to the movie
[F.cdata] = newCdata{:};
% and play the resized movie
movie(F,10)
請注意,這不會贏得任何可讀性獎品,所以如果你要使用它,請附上評論描述它的功能。
謝謝你的回答。沒有更改框架尺寸的簡單方法嗎?我用我的384 x 288陣列很好,我只是希望它顯示兩倍的大小。 – maupertius
@maupertius:你走了,更新了我的答案。 –
工作很好!謝謝 – maupertius