I'n very new to matlab! The code itself does work but and i've had to simplify it because it's for coursework, but i have a for loop with if and and else if inside it to meet some conditions
s=0;
for i=1:N; if 22==X(i) & 0<Y(i) & 2002==Z(i); s=s+1; else if 22==C(i) & 0<D(i) & 2002==Z(i); s=s+1; end endend
but the problem is that I think it changes the values to 0/1 according to whether it's true or not, but i want the actual sum of values of the goals (here it's Y and D)?
Best Answer