I'd like to assign elements to an array in the following manner:
a = zeros(2,2,2);ix=1;iy=1;b = [1,1];a([ix,iy],:) = b(:)
Where ix and iy represent the position in the 1st and 2nd directions, a in it's 3rd dimension and b are the same length length. For my application ix and iy really need to be in the same array and the method needs to be applicable to N-dimensions. Is there a way to do such an assignment?
Best Answer