フィルターのクリア

what is the expect command???????

3 ビュー (過去 30 日間)
VIJAY
VIJAY 2018 年 8 月 14 日
コメント済み: OCDER 2018 年 8 月 14 日
i have a matrix is A.The size of matrix of A is 16*18.
The matrix B=[ 5 15;
7 5;
10 11;
11 13;
12 16;
14 9;
16 7;];
i want to delete 5th row the 15th column then
i want to delete 7throw the 5th column then
i want to delete 10row the 11 column then
i want to delete 11row the 13 column then
i want to delete 12row the 16 column then
i want to delete 14row the 9 column then
i want to delete 16row the 7 column then
what is the a logic?????? if i use for loop the array size is changed so its index out of bounds.......... But the array size of A matrix is changed .

採用された回答

OCDER
OCDER 2018 年 8 月 14 日
Don't delete one-by-one. Instead, delete all rows at once, then all columns at once.
A = rand(16, 18);
B =[ 5 15;
7 5;
10 11;
11 13;
12 16;
14 9;
16 7]; %I'm guessing B(:,1) stores the rows to delete, B(:,2) stores columns to delete
A(B(:, 1), :) = [];
A(:, B(:, 2)) = [];
  2 件のコメント
Stephen23
Stephen23 2018 年 8 月 14 日
+1 good thinking.
OCDER
OCDER 2018 年 8 月 14 日
thanks! I hope this is the answer to the riddle...

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by