MATLAB: Finding the indices of duplicate maximum number of non zero element in matrix

matrix

I have this matrix
A=[-1 -0.3313 0 1 0.55 -0.2186 -1.0041 -0.0297 0 0.0041 0 0.0297;
0 0 0 0 1.09 -0.09 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0.5 0.5;
0 0 0 0 0 0 0 0 0 0 -0.375 1.375;
-1 0.2108 0 1 -0.35 0.1392 -0.9675 0.238 0 -0.0325 0 -0.238];
I want to find a rows that gives me maximum number of non zero element.
answer should be row=[1,5]
I use this one [~,Q1]=max(sum(A~=0,2) ) but it does not give [1,5]

Best Answer

EDITED
Note: max only returns the index of the max value at the first instant so in order to find all the indices of max value you would have to use find().
A=[-1 -0.3313 0 1 0.55 -0.2186 -1.0041 -0.0297 0 0.0041 0 0.0297;
0 0 0 0 1.09 -0.09 0 0 0 0 0 0;
0 0 0 0 0 0 0 0 0 0 0.5 0.5;
0 0 0 0 0 0 0 0 0 0 -0.375 1.375;
-1 0.2108 0 1 -0.35 0.1392 -0.9675 0.238 0 -0.0325 0 -0.238];
a=(sum(A~=0,2));
Row=find(a==max(a)).'
Gives:
Row =
1 5