Delete rows from matrix

9 ビュー (過去 30 日間)
Mohamed Imbaby
Mohamed Imbaby 2019 年 5 月 9 日
編集済み: madhan ravi 2019 年 5 月 9 日
Let's say we have matrix A=[1 2 3; 4 5 6; 7 8 9; 10 11 12], and b a number the user is inserting.
I want to delete 1st row if b=1, or delete the 2nd row if b=2 etc. Is this possible?

採用された回答

madhan ravi
madhan ravi 2019 年 5 月 9 日
編集済み: madhan ravi 2019 年 5 月 9 日
A=[ 1 2 3;...
4 5 6;...
7 8 9;...
10 11 12]
b=2;
A(b,:)=[]

その他の回答 (1 件)

KSSV
KSSV 2019 年 5 月 9 日
b = 1 ;
A(b,:) = [] ;

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by