The given matrix is N X M matrix which has elements equal to Zero, one and 'X'.. Generally this matrix will have very elements equal to Zeros or Ones but majority of elements equal to 'X'. This is the matrix generated by Electronic circuit. The size of the matrix is too big. Hence I would like to find total number of elements equal to Zero or one. The basic idea is to find sparseness and density of the matrix based on count of elements equal to zero or one. The matrix looks like: $$
\begin{matrix}
1 & 0 & x & x & x & x & 0 & x & 0 & x & 1\\
x & x & x & x & 0 & x & x & x & x & x & 0\\
0 & x & x & x & x & 1 & x & 1 & x & x & x\\
\end{matrix}
$$
\begin{matrix}
1 & 0 & x & x & x & x & 0 & x & 0 & x & 1\\
x & x & x & x & 0 & x & x & x & x & x & 0\\
0 & x & x & x & x & 1 & x & 1 & x & x & x\\
\end{matrix}
$$
Last edited: