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

KSSV
KSSV 2017년 4월 6일
How you are running this code?
Adam
Adam 2017년 4월 6일
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 |

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

질문:

2017년 4월 6일

댓글:

2017년 4월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by