MATLAB: How to find Place on non zero values in matrix

MATLAB

hey all
i need to find places of 1's in matrix A:
A = [0,0,0,1,0,0,1,1,0;0,0,1,0,0,0,0,0,1;0,0,0,0,1,0,0,0,0]
result = {[4,7,8];[3,9];5}
please help

Best Answer

>> A = [0,0,0,1,0,0,1,1,0;0,0,1,0,0,0,0,0,1;0,0,0,0,1,0,0,0,0];
>> [R,C] = find(A);
>> X = accumarray(R,C,[],@(v){v.'});
>> X{:}
ans =
4 7 8
ans =
3 9
ans =
5