Matlab Gurus-
My question concerns how to close and clear memory allocated to
OffScreen windows.
I am writing an experiment (on a PC) in which I want to indefinitely
present an array of images every several hundred milliseconds, much
like an RSVP paradigm. I can successfully write my images to
OffScreenWindows and Copy these to the screen just fine. The gist of
the code is something like:
for pp = 1:number_of_presentations
draw stimuli to offscreenwindow
copy offscreen contents to onscreen
present stimuli for XXXms
close offscreenwindow
end
However, as the number of presentations (pp) increases, it seems that
there is a problem in clearing the memory from the previous
presentations. My intention is to close (and clear?) the contents of
the OffScreenWindow once it has been presented. Despite my efforts
to close (and clear) this window, I suspect that new memory is being
allocated every time I want to draw on an OffScreenWindow. My
suspicion is prompted by two factors: First, after many trials,
Matlab is very slow at returning to the Command Window. Second, I
put a counter in the while loop, responsible for maintaining each
stimuli on the screen for a set amount of time. The number of
iterations in this while loop decreases exponentially as the
experiment progresses.
How can I be sure that the memory for the OffScreenWindow is being
cleared? Is there a difference between closing a window and clearing
the memory used to draw the window? Are these even the right
questions to be asking? (I can fake my way through Matlab, but I
have no other programming experience.)
Thanks,
Jason
PS - This experiment is being incorporated with an Eyelink 2.
--
My question concerns how to close and clear memory allocated to
OffScreen windows.
I am writing an experiment (on a PC) in which I want to indefinitely
present an array of images every several hundred milliseconds, much
like an RSVP paradigm. I can successfully write my images to
OffScreenWindows and Copy these to the screen just fine. The gist of
the code is something like:
for pp = 1:number_of_presentations
draw stimuli to offscreenwindow
copy offscreen contents to onscreen
present stimuli for XXXms
close offscreenwindow
end
However, as the number of presentations (pp) increases, it seems that
there is a problem in clearing the memory from the previous
presentations. My intention is to close (and clear?) the contents of
the OffScreenWindow once it has been presented. Despite my efforts
to close (and clear) this window, I suspect that new memory is being
allocated every time I want to draw on an OffScreenWindow. My
suspicion is prompted by two factors: First, after many trials,
Matlab is very slow at returning to the Command Window. Second, I
put a counter in the while loop, responsible for maintaining each
stimuli on the screen for a set amount of time. The number of
iterations in this while loop decreases exponentially as the
experiment progresses.
How can I be sure that the memory for the OffScreenWindow is being
cleared? Is there a difference between closing a window and clearing
the memory used to draw the window? Are these even the right
questions to be asking? (I can fake my way through Matlab, but I
have no other programming experience.)
Thanks,
Jason
PS - This experiment is being incorporated with an Eyelink 2.
--