how to delete row and column at a single command????????????

1 次查看(过去 30 天)
A=[1 2 3 4 5; 6 7 8 9 10; 11 12 13 14 15; 16 17 18 19 20;];
I want to delete 2row and 2 column,4 row and 4 column
my require output is
a=[1 3 5; 11 13 15]

回答(3 个)

Matt J
Matt J 2018-8-12
a=A(1:2:end,1:2:end),

KALYAN ACHARJYA
KALYAN ACHARJYA 2018-8-12
编辑:KALYAN ACHARJYA 2018-8-12
A(:,[2 4])=[]; A([2 4],:)=[];
  3 个评论

请先登录,再进行评论。


Paolo
Paolo 2018-8-12
A(:,2:2:4) = [];
A(2:2:4,:) = [];

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by