Psychtoolbox循环的每次结果都截图的话怎么办??

Screen('Preference', 'SkipSyncTests', 1);
sca;
clear;
close all;
PsychDefaultSetup(2);
[w,rect]=Screen('OpenWindow',0);
Screen('BlendFunction', w, 'GL_SRC_ALPHA', 'GL_ONE_MINUS_SRC_ALPHA');
nline=20;
for trial=1:5
for i=1:nline
angle=360rand;
l=rect(4)/4
rand+100;
x=rect(3)/1.28rand+200;
y=rect(4)/1.6
rand+200;
colors=255rand(1,3);
xy=[x,x+l
cosd(angle);y,y+l*sind(angle)];
Screen('DrawLines',w,xy,2, colors,[],1);
end
Screen('Flip',w);
kbwait;
end
sca;
我想把这五次循环的结果一张一张的保存下来 应该怎么办??用了get image但是总是保存最后一次的循环结果😭很崩溃