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

10 次查看(过去 30 天)
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

采纳的回答

Sheng Chen
Sheng Chen 2019-3-13
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Entering Commands 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by