Random only for the first stimulus

Hello everybody!

I'm trying to program an "alea command", in the way to introduce a random choice of stimuli, but ONLY for the first stimulus. You can see the basic script in the files ('Script Libet').


But the problem is this one :
The first stimulus must be random (the first position on the clock must vary), but the second, the third, etc must continue according to the first stimulus.
For example: if the first stimulus is Pos23, then must appear Pos24, Pos25, etc.

I have try that command, but without success.

for i=1:nItems
alea=randperm(60);
items=items(alea);
Screen('drawtexture', w, tex(i))
vbl=Screen(w, 'Flip', vbl+(2.5*cycleRefresh));
KbCheck;
end

Thank you :)
I'm not entirely sure what you mean, but perhaps this is what you want:

startingPosition = randi(numberOfPositions);
positionOrder = [startingPosition:numberOfPositions 1:startingPosition-1];

--- In psychtoolbox@yahoogroups.com, "emiliecaspar" <emiliecaspar@...> wrote:
>
> Hello everybody!
>
> I'm trying to program an "alea command", in the way to introduce a random choice of stimuli, but ONLY for the first stimulus. You can see the basic script in the files ('Script Libet').
>
>
> But the problem is this one :
> The first stimulus must be random (the first position on the clock must vary), but the second, the third, etc must continue according to the first stimulus.
> For example: if the first stimulus is Pos23, then must appear Pos24, Pos25, etc.
>
> I have try that command, but without success.
>
> for i=1:nItems
> alea=randperm(60);
> items=items(alea);
> Screen('drawtexture', w, tex(i))
> vbl=Screen(w, 'Flip', vbl+(2.5*cycleRefresh));
> KbCheck;
> end
>
> Thank you :)
>
Maybe more precisions on the script : I use 60 pictures (named Pos0 --> Pos59), which represent the 60 positions on the seconds on a clock. So, the positions must follow always the same order. But, I need that the first picture is random. For example, if the program choses the picture corresponding to the 21 on the clock, then the next stimulus must be 22 on the clock, etc.

I could create 60 different external lists, but I'm sure that there is an easier solution.

Maybe if I indicate the sequential order of the pictures (for example with something like "positionorder") in the script, I can then ask to take one stimulus at random in that list, but then to present the picture +1.
But I have absolutely not idea how to do that.




--- In psychtoolbox@yahoogroups.com, "gennaer" <gennaer@...> wrote:
>
> I'm not entirely sure what you mean, but perhaps this is what you want:
>
> startingPosition = randi(numberOfPositions);
> positionOrder = [startingPosition:numberOfPositions 1:startingPosition-1];
>
> --- In psychtoolbox@yahoogroups.com, "emiliecaspar" <emiliecaspar@> wrote:
> >
> > Hello everybody!
> >
> > I'm trying to program an "alea command", in the way to introduce a random choice of stimuli, but ONLY for the first stimulus. You can see the basic script in the files ('Script Libet').
> >
> >
> > But the problem is this one :
> > The first stimulus must be random (the first position on the clock must vary), but the second, the third, etc must continue according to the first stimulus.
> > For example: if the first stimulus is Pos23, then must appear Pos24, Pos25, etc.
> >
> > I have try that command, but without success.
> >
> > for i=1:nItems
> > alea=randperm(60);
> > items=items(alea);
> > Screen('drawtexture', w, tex(i))
> > vbl=Screen(w, 'Flip', vbl+(2.5*cycleRefresh));
> > KbCheck;
> > end
> >
> > Thank you :)
> >
>
gennear's solution does just what you describe. If you don't know how to do that, you better find someone near you that you can talk to in person to figure things out. Its unlikely anyone on the list will write the script for you.
Best,
Dee

On Tue, Nov 20, 2012 at 9:48 PM, emiliecaspar <emiliecaspar@...> wrote:

Maybe more precisions on the script : I use 60 pictures (named Pos0 --> Pos59), which represent the 60 positions on the seconds on a clock. So, the positions must follow always the same order. But, I need that the first picture is random. For example, if the program choses the picture corresponding to the 21 on the clock, then the next stimulus must be 22 on the clock, etc.

I could create 60 different external lists, but I'm sure that there is an easier solution.

Maybe if I indicate the sequential order of the pictures (for example with something like "positionorder") in the script, I can then ask to take one stimulus at random in that list, but then to present the picture +1.
But I have absolutely not idea how to do that.



--- In psychtoolbox@yahoogroups.com, "gennaer" <gennaer@...> wrote:
>
> I'm not entirely sure what you mean, but perhaps this is what you want:
>
> startingPosition = randi(numberOfPositions);
> positionOrder = [startingPosition:numberOfPositions 1:startingPosition-1];
>
> --- In psychtoolbox@yahoogroups.com, "emiliecaspar" <emiliecaspar@> wrote:
> >
> > Hello everybody!
> >
> > I'm trying to program an "alea command", in the way to introduce a random choice of stimuli, but ONLY for the first stimulus. You can see the basic script in the files ('Script Libet').
> >
> >
> > But the problem is this one :
> > The first stimulus must be random (the first position on the clock must vary), but the second, the third, etc must continue according to the first stimulus.
> > For example: if the first stimulus is Pos23, then must appear Pos24, Pos25, etc.
> >
> > I have try that command, but without success.
> >
> > for i=1:nItems
> > alea=randperm(60);
> > items=items(alea);
> > Screen('drawtexture', w, tex(i))
> > vbl=Screen(w, 'Flip', vbl+(2.5*cycleRefresh));
> > KbCheck;
> > end
> >
> > Thank you :)
> >
>


make a vector like this:

randinum = % however you choose the starting value, ie randint()

indexes = [randinum:60 1:(randinum-1)]

for i = indexes

% the rest of your for loop goes here

end

-----Original Message-----
From: emiliecaspar [mailto:emiliecaspar@...]
Sent: Tuesday, November 20, 2012 5:49 AM
To: psychtoolbox@yahoogroups.com
Subject: [psychtoolbox] Re: Random only for the first stimulus

Maybe more precisions on the script : I use 60 pictures (named Pos0 -->
Pos59), which represent the 60 positions on the seconds on a clock. So, the
positions must follow always the same order. But, I need that the first
picture is random. For example, if the program choses the picture
corresponding to the 21 on the clock, then the next stimulus must be 22 on
the clock, etc.

I could create 60 different external lists, but I'm sure that there is an
easier solution.

Maybe if I indicate the sequential order of the pictures (for example with
something like "positionorder") in the script, I can then ask to take one
stimulus at random in that list, but then to present the picture +1.
But I have absolutely not idea how to do that.




--- In psychtoolbox@yahoogroups.com, "gennaer" <gennaer@...> wrote:
>
> I'm not entirely sure what you mean, but perhaps this is what you want:
>
> startingPosition = randi(numberOfPositions); positionOrder =
> [startingPosition:numberOfPositions 1:startingPosition-1];
>
> --- In psychtoolbox@yahoogroups.com, "emiliecaspar" <emiliecaspar@> wrote:
> >
> > Hello everybody!
> >
> > I'm trying to program an "alea command", in the way to introduce a
random choice of stimuli, but ONLY for the first stimulus. You can see the
basic script in the files ('Script Libet').
> >
> >
> > But the problem is this one :
> > The first stimulus must be random (the first position on the clock must
vary), but the second, the third, etc must continue according to the first
stimulus.
> > For example: if the first stimulus is Pos23, then must appear Pos24,
Pos25, etc.
> >
> > I have try that command, but without success.
> >
> > for i=1:nItems
> > alea=randperm(60);
> > items=items(alea);
> > Screen('drawtexture', w, tex(i))
> > vbl=Screen(w, 'Flip', vbl+(2.5*cycleRefresh)); KbCheck; end
> >
> > Thank you :)
> >
>




------------------------------------

Post your message to: psychtoolbox@yahoogroups.com Please indicate OS9, OSX,
or WIN version, and include your full name.
Denis Pelli, David Brainard, and Allen Ingling.
http://psychtoolbox.org
Yahoo! Groups Links
I'm going to try to use solutions described.
Thank a lot for your answers!
-Emilie

--- In psychtoolbox@yahoogroups.com, "Alan Robinson" <meetup@...> wrote:
>
> make a vector like this:
>
> randinum = % however you choose the starting value, ie randint()
>
> indexes = [randinum:60 1:(randinum-1)]
>
> for i = indexes
>
> % the rest of your for loop goes here
>
> end
>
> -----Original Message-----
> From: emiliecaspar [mailto:emiliecaspar@...]
> Sent: Tuesday, November 20, 2012 5:49 AM
> To: psychtoolbox@yahoogroups.com
> Subject: [psychtoolbox] Re: Random only for the first stimulus
>
> Maybe more precisions on the script : I use 60 pictures (named Pos0 -->
> Pos59), which represent the 60 positions on the seconds on a clock. So, the
> positions must follow always the same order. But, I need that the first
> picture is random. For example, if the program choses the picture
> corresponding to the 21 on the clock, then the next stimulus must be 22 on
> the clock, etc.
>
> I could create 60 different external lists, but I'm sure that there is an
> easier solution.
>
> Maybe if I indicate the sequential order of the pictures (for example with
> something like "positionorder") in the script, I can then ask to take one
> stimulus at random in that list, but then to present the picture +1.
> But I have absolutely not idea how to do that.
>
>
>
>
> --- In psychtoolbox@yahoogroups.com, "gennaer" <gennaer@> wrote:
> >
> > I'm not entirely sure what you mean, but perhaps this is what you want:
> >
> > startingPosition = randi(numberOfPositions); positionOrder =
> > [startingPosition:numberOfPositions 1:startingPosition-1];
> >
> > --- In psychtoolbox@yahoogroups.com, "emiliecaspar" <emiliecaspar@> wrote:
> > >
> > > Hello everybody!
> > >
> > > I'm trying to program an "alea command", in the way to introduce a
> random choice of stimuli, but ONLY for the first stimulus. You can see the
> basic script in the files ('Script Libet').
> > >
> > >
> > > But the problem is this one :
> > > The first stimulus must be random (the first position on the clock must
> vary), but the second, the third, etc must continue according to the first
> stimulus.
> > > For example: if the first stimulus is Pos23, then must appear Pos24,
> Pos25, etc.
> > >
> > > I have try that command, but without success.
> > >
> > > for i=1:nItems
> > > alea=randperm(60);
> > > items=items(alea);
> > > Screen('drawtexture', w, tex(i))
> > > vbl=Screen(w, 'Flip', vbl+(2.5*cycleRefresh)); KbCheck; end
> > >
> > > Thank you :)
> > >
> >
>
>
>
>
> ------------------------------------
>
> Post your message to: psychtoolbox@yahoogroups.com Please indicate OS9, OSX,
> or WIN version, and include your full name.
> Denis Pelli, David Brainard, and Allen Ingling.
> http://psychtoolbox.org
> Yahoo! Groups Links
>

Hi Emilie. Where can I find this script? I am also interested in the libet task