フィルターのクリア

Filter a matrix of data

88 ビュー (過去 30 日間)
Atique Malik
Atique Malik 2020 年 3 月 4 日
コメント済み: Atique Malik 2020 年 3 月 4 日
I have a data matrix, 2 columns and N rows. Lets call the columns x and y. I want all rows that meet teh following condition (X<25 and Y>30) to be nulled out of the original matrix and stored in a new matrix.

採用された回答

Rik
Rik 2020 年 3 月 4 日
Just use logical indexing:
N=100;data=randi(100,N,2)/2;%generate random data
L=data(:,1)<25 & data(:,2)>30;
newdata=data(L,:);
data(L,:)=[];
  1 件のコメント
Atique Malik
Atique Malik 2020 年 3 月 4 日
Thanks!

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by