I have a 3D matrix (a2).
I want to find the index of elements in a2 <= -0.1 in the first dimension for all trials (trl) and experiments (exp). Some of my trials (trl) don't have values <=-0.1, and for these I would like to assign them with NaN.
I've had a go at writing code, but my if elseif statement is completely off. Can someone please give me some pointers on what I should do.
for exp = 1:12
[row] = find(a2(:,trl,exp)<=-0.1,1);