I’m trying to use fillOval in my Matlab program
width = 20;
x = round(rand()*size(3)) - width;
y = round(rand()*size(4)) - width;
Screen(wPtr, 'FillOval', [130 130 130], [x y width width]);
and I get the error:
??? Error using ==> Screen
Usage:
Screen('FillOval', windowPtr [,color] [,rect] [,perfectUpToMaxDiameter]);
Error in ==> Test at 18
Screen(wPtr, 'FillOval', [130 130 130], [x y width width]);
When I replace the x, y, and width variables with values in the Screen() call, I don’t get the error.
What’s wrong?
rectshould be a 1×4 vector. When I use your code it is a 1×6 vector. It looks like you’ve accidentally overloaded thesize()function with somesizevariable that you did not include in your example, and this is causing problems. If you name yoursizevariable something else, and ensure that when you test out[x y width width]you get back a 1×4 vector, it should work.Also, I assume you’re talking about the PsychToolbox, but this isn’t mentioned in your post either.