MATLAB: Emptying each row of a matrix in a loop

emptyloopmatrix

Is there a way to empty each row of a matrix in a loop? For example
a = [1 2;
1 3;
1 5;
1 7;
1 8;];
first loop
a = [
1 3;
1 5;
1 7;
1 8;];
second loop
a = [1 2;
1 5;
1 7;
1 8;];
and so on until the last loop
a = [1 2
1 3;
1 5;
1 7;
];

Best Answer

a0=a;
for i=1:size(a,1)
a=a0;
a(i,:)=[],
end