Welcome! Log In Create A New Profile

Advanced

Adapter Position

Posted by marmosets 
Adapter Position
August 05, 2020 07:08PM
Hello again!

I am working on building a task in Runtime V2. I am using the adapters available to build task objects and set their position. However, I am unable to set the position of an object as 0,0. I receive the error "Array indices must be positive integers or logical values." Is it possible to place objects at 0,0?

I have attached my timing script here and am specifically referencing Scene 5 in the script.

Thank you!
Attachments:
open | download - dmsTwoChoice_NoCueIncorrectDelayAdapterStimuli_V2.m (7.6 KB)
Re: Adapter Position
August 06, 2020 04:38AM
You are mistaken. The error occurred because you did something wrong with create_scene(), not because you set the position [0 0].
https://monkeylogic.nimh.nih.gov/docs_RuntimeFunctions.html#create_scene
Re: Adapter Position
August 07, 2020 11:47AM
Hello again!

Thank you for the advice! That pointed me in the right direction and I was able to figure out my mistake.

Could you explain why the error I was receiving referenced needing positive integers in an array when the issue actually had to do with how I was calling adapters in create_scene()? I am having a hard time understanding exactly what the error was trying to tell me and why it went away when I changed the position values.

Thank you!
bts
Re: Adapter Position
August 07, 2020 12:53PM
When you created scene 5, you called black_box.Position instead of a(n) taskobject(s). When black_box.Position was [0 0], you were asking ML to create scene 5 with task objects 0 and 0, which do not exist. If you changed it to positive integers, e.g. [1 2], you were creating scene 5 with task objects 1 and 2, which would work.
Re: Adapter Position
August 07, 2020 03:04PM
That makes tons of sense! Thank you for clarifying, that was really helpful!

The National Institute of Mental Health (NIMH) is part of the National Institutes of Health (NIH), a component of the U.S. Department of Health and Human Services.