Welcome! Log In Create A New Profile

Advanced

Error on Run exit

Posted by aboharbf 
Error on Run exit
September 21, 2019 04:57PM
Upon finishing some set of trials, I end up with the following error:
<<< MonkeyLogic >>> Index exceeds the number of array elements (1). (mltaskobject.subsref, Line 163)
Index exceeds the number of array elements (1).

Error in mltaskobject/subsref (line 163)
                                varargout{1} = builtin('subsref',obj,s);

Error in mlbhv2/write_recursively (line 223)
                            for n=1:nfield, write_recursively(obj,val(m).(field{n}),field{n}); end

Error in mlbhv2/write_recursively (line 223)
                            for n=1:nfield, write_recursively(obj,val(m).(field{n}),field{n}); end

Error in mlbhv2/write (line 79)
            write_recursively(obj,val,name)

Error in mltrialrecord/export_to_file (line 239)
                fobj.write(dest,varname);

Error in run_trial (line 178)
    TrialRecord.export_to_file(fobj);

Error in monkeylogic/UIcallback (line 871)
                    result = run_trial(MLConfig,datafile);
Re: Error on Run exit
September 23, 2019 11:56AM
Thanks for the task files. They were helpful. There were new TaskObject properties not copied properly.

To fix it, put the following code after Line 75 of mltaskobject.m
val.Scale = [val.Scale varargin{m}.Scale];
val.Angle = [val.Angle varargin{m}.Angle];

Or download the packages again.
Re: Error on Run exit
September 23, 2019 12:49PM
Fantastic! I had actually been tinkering with it the last hour and landed on adding :

                            case {'Scale'}
                                varargout{1} = 1; %DuctTape 
                            case {'Angle'}
                                varargout{1} = 0; %DuctTape

to mltaskobject.m around the error, since I don't scale or angle my TaskObjects I figured it would be a good quick fix. Glad I can help, and thanks a ton for your help.
Re: Error on Run exit
September 23, 2019 02:21PM
Thank you for letting me know the issue and providing the test material. It would take a lot longer for me to find it, if it were not for your help!

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.