I have a simple 3D matrix. Every time I do this operation on the (:,:,1) matirx it gives me an error saying "A null assignment can have only one non-colon index." I dont understand this. But in a simple 2D matrix it works. If I assign "NaN" instead of "[]" then the second row is assigned with NaN NaN values (in 3D). Can I not delete the row in a 3D matrix? Appreciate some insight to this.
A(:,:,1) = [1 2 ; 0 5 ; 7 8 ];A(:,:,2) = [10 11 ; 1 14 ; 0 17 ];A((A(:,1,1).*A(:,2,1))==0,:,1)=[]
Best Answer