Is there an inbuilt function that removes the Kth row and column of a square matrix in Matlab?
Hope it's clear from the diagram:
Is there an inbuilt function that removes the Kth row and column of a square matrix in Matlab?
Hope it's clear from the diagram:
Not a builtin function, but the following line does the trick:
y = [x(1:(k-1),1:(k-1)) x(1:(k-1),(k+1):end) ; x((k+1):end,1:(k-1)) x((k+1):end,(k+1):end)];
Here are two simple solutions:
x([1:k-1 k+1:end],[1:k-1 k+1:end])
or:
x(k,:)=[];x(:,k)=[];