MATLAB: Calculating the percentage of numbers in the matrix

matrixpercentage

A = [ 18 4; 15 12; 12 0; 6 44 ;8 3; 2 22; 3 67; 5 32; 20 32; 10 4];
I have this matrix and i want to get the percentage of having numbers less than 10

Best Answer

P = sum(A(:)<10)/numel(A)*100;