Hi Enrico,
There is a small mistake in the logic where you compare the upperbound and lowerbound with the actual values.
upperbound(n:1) & lowerbound(n:1) will return a 0X1 column vector, it might be the line which is causing the error.
The corrected code is as follows,
for x=1:6
upperbound(x,:) = mean(r_logActual(:,x))+3*std(r_logActual(:,x));
lowerbound(x,:) = mean(r_logActual(:,x))-3*std(r_logActual(:,x));
end
for n = 1:6
if r_logActual(:,n) <= upperbound(n,1) & r_logActual(:,n) >= lowerbound(n,1)
emp_prob(x)=1;
else
emp_prob(x)=0;
end
end
Hope it will resolve the issue.