Creating list or vector with numerical values & getting n-th element out of this list


Author
Message
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 100K
Assuming you did something like

<expressions>
/ getlossdeck1 = sequence(0, 0, 0, 0, 0, 0, 0, 0, 0, 1250)
/ getlossdeck2 = sequence(0, 0, 0, 0, 0, 150, 200, 250, 300, 350)
/ getlossdeck3 = sequence(0, 0, 0, 0, 0, 0, 50, 50, 50, 50)
/ getlossdeck4 = sequence(0, 0, 0, 0, 0, 0, 0, 0, 0, 250)
</expressions>

there is no reason why the decks should be "in sync". If e.g. "deck 1" is selected
<trial igt>
...
/ ontrialend = [ if (trial.igt.response == "deck1") {... ; values.loss=expressions.getlossdeck1; ...}]
...
</trial>

A single sample is retrieved from expressions.getlossdeck1. The remaining expressions are (supposed to be) wholly unaffected -- no samples are retrieved.

The quickest, but somewhat hack-ish, way to change that is to retrieve a sample from *every* expression regardless of the deck chosen:

<trial igt>
...
/ ontrialend = [ if (trial.igt.response == "deck1") {... ; values.loss=expressions.getlossdeck1; expressions.getlossdeck2; expressions.getlossdeck3; expressions.getlossdeck4;...}]
/ ontrialend = [ if (trial.igt.response == "deck2") {... ; values.loss=expressions.getlossdeck2; expressions.getlossdeck1; expressions.getlossdeck3; expressions.getlossdeck4;...}]
...
</trial>

fasteddie9141
fasteddie9141
Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)Respected Member (492 reputation)
Group: Forum Members
Posts: 2, Visits: 32
Thanks for this I will give it a hack so to speak

Apologies for doubling up with PM

Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 100K
No problem. Let me know how it goes!

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search