how i can remove row and column from matrix

6 ビュー (過去 30 日間)
abdelazeem hassan
abdelazeem hassan 2016 年 7 月 29 日
コメント済み: Walter Roberson 2016 年 7 月 30 日
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]

採用された回答

Walter Roberson
Walter Roberson 2016 年 7 月 29 日
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 件のコメント
Image Analyst
Image Analyst 2016 年 7 月 30 日
Try
A = A([1, 3:end], [1, 3:end]);
Walter Roberson
Walter Roberson 2016 年 7 月 30 日
Sorry, yes, I made a typing mistake.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by