Filter out incorrect responses?

If I have a dataset, in which the correct response was 1 and the incorrect response was 0, how can I filter out the participants with incorrect responses? I have to write this as a script in matlab.
Thanks.

 Respuesta aceptada

Star Strider
Star Strider el 16 de Nov. de 2016
If the responses are integers, and if I understand your problem correctly, this will work:
subjects = 1:10;
responses = randi([0 1], 1, 10);
subj_resp = [subjects; responses]
keep_responses = find(responses == 1)
subj_resp =
1 2 3 4 5 6 7 8 9 10
0 1 0 1 1 0 1 0 0 1
keep_responses =
2 4 5 7 10

Más respuestas (0)

Etiquetas

Preguntada:

el 16 de Nov. de 2016

Respondida:

el 16 de Nov. de 2016

Community Treasure Hunt

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

Start Hunting!

Translated by