フィルターのクリア

How to remove some values in a matrix?

2 ビュー (過去 30 日間)
ruik zhang
ruik zhang 2018 年 7 月 28 日
コメント済み: ruik zhang 2018 年 7 月 28 日
Hello,
For example I have a matrix
[66 62;
64 70;
62 100];
In the first column, I just want keep those values between 60 and 65, in the second column, I want to keep the values between 61 and 70, if not those case, I want to delete those rows. namely the new matrix will be [64 70];

採用された回答

Walter Roberson
Walter Roberson 2018 年 7 月 28 日
mask = A(:,1) >= 60 & A(:,1) <= 65 & A(:,2) >= 61 & A(:,2) <= 70;
B = A(mask,:);
  1 件のコメント
ruik zhang
ruik zhang 2018 年 7 月 28 日
Appreciated and it works well.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAuthor Block Masks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by