I have a series of ND arrays of the same size filled with zeroes and ones. I want to combine the array with the following rules:
If at the X and Y position for all arrays there is a zero, the final array will be a zero. If there is a 1 at any location, the final array will have a 1 at that location.
However, I am getting an error message of 'Attempt to grow array along ambiguous dimension.
This is the logic of the code I have so far:
p = 1;
while (some condition holds true)
S(:,:,p) = (M - y).^2 + (N - x).^2 <= radius.^2;
p = p+1;
D = zeros(M,N);
index1Loc = sum(S,p-1) ~= 0;
D(index1Loc) = 1;