>Hi,
>
>I'm sorry to bother you--I am a first year graduate student working this
>quarter for Mike Shadlen at the University of Washington. I am trying to
>write a program for a visual psychophysics experiment that involves
>multiple 60 frame videos. The program worked fine with the Screen(Put
>Image) function except it was running too slowly. I of course realized why
>after I looked at the PutImage function.
>
>I've changed to a Screen(OpenOffScreenWindow), Screen(PutImage),
>Screen(CopyWindow) sequence. However, this causes the program to crash
>after a few trials, saying I either don't have enough memory or "???
>SCREENOpenOffscreenWindow.c: NewGWorld error -108.
>174 x 489 x 32 bits." I am clearing variables after their use, and MATLAB
>workspace memory is nowhere near to the 100MB I am giving MATLAB. So I
>have two questions. (1) Is there a better way to make movies that run at
>my monitor's refresh rate (75 Hz)? (2) Do you know what could cause the
>"NewGWorld" error?
>
>I've been trying to figure this out for quite some time, but so far I have
>had no success. Any comments would be greatly appreciated.
>
>Thanks so much,
>Sarah Allred
dear sarah
1. You're doing the right thing. MovieDemo.m is a good model for what you
want to do. You should be precomputing lots of images, putting each in
its own offscreen window. Don't forget to CLOSE those windows when you're
through with them. Each allocated window takes up memory. If you allocate
(i.e. open) new windows for each trial, and don't free (i.e. close) the
old ones, you'll quickly run out of memory.
2. The NewGWorld error, -108, means "not enough memory". Note that
allocating a GWorld, by SCREEN, is preferentially done in the so called
"Temp" memory that belongs to the Mac OS. I wonder if you might have
assigned ALL your memory to MATLAB and left none free for the Mac OS. If
so, you'll solve your problem by REDUCING the memory allocation to MATLAB.
3. The mex function BYTES will report how much regular and "Temp" memory
are available. Printing those values out before and after each trial will
help you track down the problem.
best
denis