Error "Not enough input arguments"

Hi,
I'm new to Matlab and am having trouble getting the following bit of script to work:
for i = 1:240;
if shape1_win(i)==1 & shape1_loss(i)==1 & button_pressed(i)==1 | shape2_win(i)==1 & shape2_loss(i)==1 & button_pressed(i)==2;
choose_both(i)=1;
else
choose_both(i)=0;
end
end
The script is for a task in which participants have to choose a shape that can have a win, a loss, or both. What I want to do is create a new variable listing all the times participants chose a shape that had both a win and a loss. The shape variables are all 240x1 double type variables.
Every time I try to run this bit, I get an error saying there are not enough input arguments (starting on line 2). I'm probably missing something very obvious, could someone explain to me how to fix this?

2 commentaires

KSSV
KSSV le 6 Avr 2017
How you are running this code?
Adam
Adam le 6 Avr 2017
Are shape1_win, shape1_loss, button_pressed, shape2_win, etc variables or functions? And is that actually 'line 2'? If it is and they are variables the error doesn't make sense as the only functions being called are & and |

Connectez-vous pour commenter.

Réponses (0)

Commenté :

le 6 Avr 2017

Community Treasure Hunt

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

Start Hunting!

Translated by