Defining stimuli inside range replicators

Hi Chris,

I am trying to assign locations to a stimulus inside nested range replicators. For example, in the RSVP example, let’s say I am flashing 5 images in a single trial. I would like to place the 5 images at separate locations. Here is a block of pseudo code to explain my question better. I understand range replicators can’t assign local variables (location_x, location_y) to a rectangle property. Ultimately, I need to calculate the rotation variable based on the x,y location as well. I can’t figure out a workaround and hope you could help me.

Thanks,
Yoon

stimulus_group my_stimuli {
    range_replicator (
        variable = location_x
        from = -area_sampled
        to = area_sampled
        step = 2
        ) {
        range_replicator (
        variable = location_y
        from = -area_sampled
        to = area_sampled
        step = 2
        ) {
            rectangle bar_stimulus (
                color = 1,1,1
                x_size = 3
                y_size = 0.2
                x_position = location_x
                y_position = location_y
                rotation = theta //needs to be calculated based on location
                )
        }
    }
}

Hi Yoon,

Please see the attached example. It uses a single, non-nested range replicator to define the stimuli. The location and rotation of each stimulus is taken from a list-valued variable. This lets you compute and assign the rotation of each stimulus inside your protocol. You could also re-assign the locations, if you wanted.

Cheers,
Chris
nested_range_reps.mwel.zip (952 Bytes)

Sorry, I should have changed the name of that example, since it doesn’t use nested replicators.