How can I compare three strings?
1 view (last 30 days)
Show older comments
Hi,
I'm trying to write a code that will compare participants first response on a task with their confidence rating and was wondering how I can compare three string statements as it returns an error stating "Error in PD_METACOG_Script (line 92)
if strncmp(current(i).code,'RealWord',8) == 1 &&
strcmp(current(i+1).code, '1') == 1 &&
((strncmp(current(i+2).event_type,'Nothing', '4')
== 1)) ||
((strncmp(current(i+2).event_type,'Nothing'"
The issue with the code is here
if strncmp(current(i).code,'RealWord',8) == 1 && strcmp(current(i+1).code, '1') == 1 && (((current(i+1).event_type,'Nothing', '4') == 1)) || (((current(i+1).event_type,'Nothing', '5') == 1)) ||(((current(i+1).event_type,'Nothing', '6') == 1))
count_hr(1,j) = count_hr(1,j)+1;
elseif strncmp(current(i).code,'RealWord',8) == 1 && strcmp(current(i+1).code, '2') == 1 && (((current(i+1).event_type,'Nothing', '4') == 1)) || (((current(i+1).event_type,'Nothing', '5') == 1)) ||(((current(i+1).event_type,'Nothing', '6') == 1))
count_falsealarm(1,j) = count_falsealarm(1,j) + 1;
end
Apologies for the basic question new to matlab and any help would be appreciated!!
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!