快速导出同一张图n次的方法

Fast way of exporting the same figure n-times

我正在尝试在 matlab 中制作动画。为此,我正在展示包含对动画中当前发生情况的描述的图片。所以我正在写出我的人物图片,然后再次使用 matlab 将这些图片组合成一个 avi 文件。对于 "show up" 足够长的描述部分,我使用了一个简单的循环,其中当前图形被保存了 n 次。不幸的是,这个过程虽然 matlab 不需要计算任何新的东西,但却是最慢的过程。 作为循环,我使用以下内容(h_f 是图形句柄):

for delay = 1:80 
export_fig (h_f,['-r' num2str(resolution)], ['C:\Users\Folder\Name_', '_' num2str(7700+delay) '.png']) 
end

我就是想问问有没有更快的方法。现在感觉就像 matlab 在导出之前每次都重新绘制无花果。那么有没有办法一次绘制图形同时导出n次呢?

感谢您的帮助:)

如果真的完全一样,那么你可以直接把第一个文件复制到后面的文件中。您的时间将受到磁盘驱动器速度和图像文件大小的限制。

% Define some of the flags as variables. This'll make it clearer
% what you're doing when you revisit the code in a year.

% Flag for the resolution
resFlag = sprintf('-r%u', resolutions);

% Base folder
folder = 'C:\Users\Folder\';

% First file number
startnum = 7701;

% This is the pattern all the filenames will use
nameToken = 'Name_%u.png';

% First filename
firstFile = fullfile(folder, sprintf(nameToken, startnum));

% Export the first file
export_fig(h_f, resFlag, firstFile);

numCopies = 80;

% Copy the file
for delay = 2:numCopies 
    % Make a new filename
    currentFile = fullfile(folder, sprintf(nameToken, startnum + delay));

    % Copy the first file into the current filename.
    copyfile(firstFile, currentFile);
end