How to increase count for different counters in if loop.
6 views (last 30 days)
I'm trying to make a counter during iterations of trials. I've been using the code below. I want count, fillcount and expcount to increase. However fillcount and expcount can only increase when a certain variable (itemtype) is a certain number.
when I run this code count increases but expcount and fillcount don't but I don't know why. All help is greatly appreciated!
a=ones(length(item),1);%vector of 1s for number of experimental pairs
b=2*ones(length(fillerorder),1); %vector of 2s for number of fillers
itemtype=c(randperm(numel(c)));%vector of 1s and 2s, 1=experimentalpair 2=filler
fillcount=fillcount+1 %increase counter by 1
expcount=expcount+2 %increase counter by 2
A Jenkins on 18 Feb 2015
You are comparing the entire itemtype array to the numbers 1 and 2. Perhaps you want to compare just one element of the array?