Hi Naomi,
In my understanding you want to write a code with if and else statements. You can use the following code snippet for doing this task:
i = 0;
nLines = numel(Lines);
for cLines = 2:nLines-1
[dat(cLines,:),marker] = FormatNK(Lines{cLines});
if data.markerNames(cLines) >= 1 && data.markerNames(cLines) <= 61 && strcmp(marker, 'gezien')
i = i+1;
result(i) = correctly_recognized;
elseif data.markerNames(cLines) >= 1 && data.markerNames(cLines) <= 61 && strcmp(marker, 'niet gezien')
i = i + 1;
result(i) = incorrectly_not_recognized;
elseif data.markerNames(cLines) >= 62 && data.markerNames(cLines) <= 122 && strcmp(marker, 'gezien')
i = i + 1;
result(i) = incorrectly_recognized;
elseif data.markerNames(cLines) >= 62 && data.markerNames(cLines) <= 122 && strcmp(marker, 'niet gezien')
i = i + 1;
result(i) = correctly_not_recognized;
end
end
Here "data.markerNames" is used as an index to access the marker names in your dataset. The code snippet above checks if the marker name is between 1 and 61 and is seen (‘gezien’) or not seen (‘niet gezien’).
If the marker name is between 62 and 122 and is seen or not seen, it will be classified as incorrectly recognized or correctly not recognized, respectively.
Please refer to the following link for “strcmp” function documentation:
Hope it helps!