MATLAB: How to select only the values in a Matrix, which don’t have the value

findMATLABrdivide

I search for an expression for that, because I can't divide by 0 and for later use I need Matrixelements which don't have the value 0. Would be glad, if someone could help me.
Matrix1Quotient = MatrixB ./ MatrixA;
This says that the matrixelements must not be 0. But don't select the elements which are ~=0:
Mat1Quot(:,:)~=0

Best Answer

i=find(~MatrixA);
Matrix1Quotient = MatrixB(i)./MatrixA(i);