how to delete row and column at a single command????????????
Afficher commentaires plus anciens
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]
1 commentaire
KALYAN ACHARJYA
le 12 Août 2018
I have edited the answer, pls check and confirm?
Réponses (3)
Matt J
le 12 Août 2018
a=A(1:2:end,1:2:end),
KALYAN ACHARJYA
le 12 Août 2018
Modifié(e) : KALYAN ACHARJYA
le 12 Août 2018
A(:,[2 4])=[]; A([2 4],:)=[];
3 commentaires
VIJAY
le 12 Août 2018
KALYAN ACHARJYA
le 12 Août 2018
A(:,[2 4])=[] %to delete 2 and 4 col simultenously
KALYAN ACHARJYA
le 12 Août 2018
Answer here
A(:,[2 4])=[]; A([2 4],:)=[];
Paolo
le 12 Août 2018
A(:,2:2:4) = [];
A(2:2:4,:) = [];
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!