Randomizing image position in a slide object

Michiel Spape Michiel.Spape at nottingham.ac.uk
Mon Feb 22 17:19:27 UTC 2010


Hi Gilis,
Yes, I noticed it sounded very matlabby :) Matlab is awesome in terms of arrays, but I'm happy enough that E-Prime at least has this randomiseArray, er randomizeArray, function. Here's how you can do about the same:
Dim locs() as integer
Dim I as integer

For i = 1 to 640
	Locs(i) = i
Next i

RandomizeArray Locs     'this would be Locs = RandomizeArray(Locs) in Matlab style

...or something of that sort to obtain 640 values which you can later insert in your trial (e.g. if a slide has an image with x value referencing [myX] and you have a trial-counter called trialnum, then something like c.SetAttrib "myX", Locs(trialnum)

Personally, I get heavily frustrated by the usage of (E-)Basic ()s which seems rather arbitrary, their lack of []s to reference arrays as in C, and can't quite wrap my mind around how all that is yet different in Matlab (including the added {}s)!

Michiel Spapé
Research Fellow
Perception & Action group
University of Nottingham
School of Psychology


-----Original Message-----
From: e-prime at googlegroups.com [mailto:e-prime at googlegroups.com] On Behalf Of gilis
Sent: 22 February 2010 16:50
To: E-Prime
Subject: Re: Randomizing image position in a slide object

Hi Mich,

Sure it make a little sense, it was just an hypothetical example ;) -
meaning that I was trying to find a way to randomize three dichotomic
values (e.g., a , c and d without the sequence between them).
Somehow   "RandomizeArray"  was associatively connected in my mind
with similar suffix functions from Matlab -I was sure it can be done
in Eprime as well...For the present experiment I will use the list,
but anyway wanted to know the alternatives. Thank you very much for
the link, I hope to use it  intensively.
Cheers
Gilis

On 22 פברואר, 18:13, Michiel Spape <Michiel.Sp... at nottingham.ac.uk>
wrote:
> Hi Gilis,
> What may be unelegant programming-wise, I often find much better psychologically, for some reason! That is, yes, it seems like an awful lot to tell a programme to use "red", "green", "blue" for a Stroop task and then having to bother with setting all 9 combinations, rather than, for example, setting one attribute (congruence) and using a little script to randomly set colours and words. Still, I would advise you to use the list anyway; it provides much more clarity for yourself and others, its randomising tends to give better results than randomizing with replacement, and, well, you don't need to learn so much E-Basic programming.
>
> Anyway, we have discussed randomising location fully and thoroughly in the seminal E-Primer (www.cognitology.eu, under references) and the easiest would be just to use percentage. I don't see where 'side' comes in... Just use two attributes [XLoc], [YLoc] if you will, use % values in your list and voila.
>
> "c.SetAttrib "side", RandomizeArray(1,3,4)"
> ...makes very little sense. If you are using "Side" to set your location, why do you want to fill it (I guess) with 1, 3 or 4? Are those pixels? 3 is about 2 pixels to the right of 1... Are you trying to randomize a list? If you have many combinations, I suggest looking up nested lists in the user guide / getting started guide.
> Cheers,
> Mich
>
> Michiel Spapé
> Research Fellow
> Perception & Action group
> University of Nottingham
> School of Psychology
>
> -----Original Message-----
> From: e-prime at googlegroups.com [mailto:e-prime at googlegroups.com] On Behalf Of gilis
> Sent: 22 February 2010 14:44
> To: E-Prime
> Subject: Randomizing image position in a slide object
>
> Hi to all again,
>
> Appologize for bothring the forum again, but it's not a too hard one I
> hope:
> I want the computer to randomly present the stimuli in the center,
> left or right side
> of the display.
>
> I know that  it can be done easily by adding attribute ("side") in the
> trial list with values of left right or center and then to define the
> X axis of the image in the slide object as [side] and that's all.
>
> However, this method means that I have to insert manualy all different
> combinations -and it's not an elegant solution.
>
> I tried to define side as a new attribute in an inline object this way
>
> c.SetAttrib "side", RandomizeArray(1,3,4)
>
> of course-it didn't work and I tried many different configurations and
> randomization commands. With which command can I randomize left,
> center and right?
>
> Thanks,
> Gilis
>
> --
> You received this message because you are subscribed to the Google Groups "E-Prime" group.
> To post to this group, send email to e-prime at googlegroups.com.
> To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/e-prime?hl=en.
>
> This message has been checked for viruses but the contents of an attachment
> may still contain software viruses which could damage your computer system:
> you are advised to perform your own checks. Email communications with the
> University of Nottingham may be monitored as permitted by UK legislation.

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list