MATLAB: How i can remove row and column from matrix

remove row column matrix

how i can remove row and column from matrix
ex: A=[1,2,3;4,5,6;7,8,9;10,11,12]
i need to remove second row and second column from the above matrix
A =[
1 3
7 9
10 12]

Best Answer

A = A([1, 3:end), [1, 3:end]);
or
A(2,:) = [];
A(:,2) = [];
You cannot use the [] delete operator on both rows and columns at the same time.