Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
ErikEmeric

Junior Member
Registered:
Posts: 25
Reply with quote  #1 
hi,
i'm having an issue trying to implement a gen task object function. when i try to test my gen function using the "test" button in the ML menu, i get the following error.

??? Error using ==> feval
Invalid function name
'C:\Users\StuphornLab2\Documents\MATLAB\Erik\genTest\drawstim1.m'.

Error in ==> mlmenu at 2456
                    imdata = feval(ob.FunctionName, TrialRecord);
 
??? Error while evaluating uicontrol Callback

this is my conditions file
Condition    Frequency    Block    Timing File        TaskObject#1
1            1            1        genTest            gen(drawstim1)

this is the gen function (just for debugging)

function [stim]=drawstim1(TrialRecord)

stim = rand(50,50);

end



this is my timing file

toggleobject(1)
idle(3000)
toggleobject(1)

any and all suggestions/solutions would be appreciated

Thanks,
Erik
0
Wael.Asaad

Administrator
Registered:
Posts: 51
Reply with quote  #2 
I assume you made sure it's not a path issue.  What happens when you try to run the task (not simply to use the "test" button)?

0
coxma

Junior Member
Registered:
Posts: 7
Reply with quote  #3 
Could an issue with the syntax of your gen function (the actual .m file named "drawstim1"). 

You have to pass "TrialRecord" to the gen function. Also, you have to output X & Y coordinates as you don't have them in your conditions file. 

So, the top of your gen function should look like this: 

function [image, X, Y] = drawstim1(TrialRecord)
0
ErikEmeric

Junior Member
Registered:
Posts: 25
Reply with quote  #4 
thanks Wael and Michele!

i implemented both of your suggestions.

the test button still results in an error, but when i run the task now, the stimulus is displayed properly. not exactly sure why that is.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.