I have a matrix A = [0 3 4; 5 0 6; 0 6 0]
;
I know that to compute the total number of zero elements, I can simply use the function find
. That is, Total_number_of_zero_elements = length(find(A==0));
and this will give me 4.
PROBLEM:
Take for example now the matrix B generated as follows:
B = toeplitz(0.1.^(0:30-1));
Total_number_of_zero_elements = length(find(B==0));
The code above will give: Total_number_of_zero_elements = 0. The matrix B contains a lot of 0 values but are written as 0.0000.
So matlab can't discriminate between 0 and 0.0000 using the function find?
Any help will be very appreciated!