No appropriate method, property, or field 'MergedKeys' for class 'PollClass'.

8 Ansichten (letzte 30 Tage)
Hi guys,
I have been trying to work on the Matlab script I have wrote to measure the RT for the task.
However, the Matlab program returns back to the screen with the following message after the first stimulus has presented (I have two stimuli to be presented, the first stimulus always appears before the onset of the second stimulus. Whar's more is response key for the first stimulus needs to be pressed before the onset of the second stimulus).
No appropriate method, property, or field 'MergedKeys' for class 'PollClass'.
More scripts are shown below:
myKbd = PollClass(0.005);
myKbd.Reset; % Time0 is set here.
Times = myKbd.Times - myKbd.Time0;
NResps = myKbd.NKeys;
if NResps==1
RT1 = myKbd.Times(1);
Resp1 = myKbd.MergedKeys;
else
RT1 = ExpInfo.NogoRT;
Resp1 = {ExpInfo.HomeKey};
end

Akzeptierte Antwort

Sheng Chen
Sheng Chen am 13 Mär. 2019
That error message means in class 'PollClass', there is no property called 'MergedKeys'
You can use isprop to check if there is such property by using the following function
tf = isprop(myKbd,'MergedKeys')
which returns true if 'MergedKeys' is a property of 'PollClass'
Or you can use
tf = ismethod(myKbd,'MergedKeys')
to check if 'MergedKeys' is a method of 'PollClass' or not.

Weitere Antworten (0)

Kategorien

Mehr zu Toolbox Distribution finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by