how i can remove row and column from matrix

6 vues (au cours des 30 derniers jours)
abdelazeem hassan
abdelazeem hassan le 29 Juil 2016
Commenté : Walter Roberson le 30 Juil 2016
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]

Réponse acceptée

Walter Roberson
Walter Roberson le 29 Juil 2016
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.
  3 commentaires
Image Analyst
Image Analyst le 30 Juil 2016
Try
A = A([1, 3:end], [1, 3:end]);
Walter Roberson
Walter Roberson le 30 Juil 2016
Sorry, yes, I made a typing mistake.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by