Welcome! Log In Create A New Profile

Advanced

more inputs to gen?

Posted by pschade 
more inputs to gen?
September 07, 2021 05:26PM
is there a way to add more inputs into our gen functions outside of what's in the TrialRecord or MLconfig? Say I want to make a task object with a few videos through a gen function that all differ by one parameter, instead of making a new function for each video, could I just add another input to the gen function to tell it which video to make? Could do something similar with a counter in TrialRecord.User, but thought there may be an easier option
Re: more inputs to gen?
September 07, 2021 06:46PM
Using TrialRecord.User is the simplest way. There is no other way to add something to GEN, because it is not you but ML that calls GEN. The function must have a predetermined declaration.
Re: more inputs to gen?
September 29, 2021 08:13AM
I might miss the point of your question. You can deliver as many input arguments as you want to your GEN with TrialRecord. There is no need to create multiple GEN functions.

If you are using a userloop, it is easy. Just assign the arguments to TrialRecord.User and read in the GEN.
TrialRecord.User.gen1 = { 1, [2 3], 'arg4' };   % for example

A different trick is needed, when you use a conditions file. See the "task\runtime v1\6 grating" example.

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.