MATLAB: How to find all rows other than a particular row

MATLAB

Hey all
how can i find all rows other than a particular row in a matrix?
matrix = [1,1,1,0,0;0,1,1,1,0;0,0,1,0,1]
result = {[2;3];[1;3];[1;2]}
e.g. if we are considering row 1 then all other rows in matrix will be shown in result except row 1

Best Answer

Let's say you have N rows.....and you have selected M'th row, then use Setdiff to get what you want.
N = 12 ; % 12 rows
M = 3; % selected 3rd row
iwant = setdiff(1:N,M)