Remove rows from matrix based on condition

I have a matrix of (125000x2),(row, column). The first column is time, and the second column is the measured voltage value from an experiment. I want to delete the rows if the measured voltage value is less (-0.08) or bigger than (0.08).

 採用された回答

Dyuman Joshi
Dyuman Joshi 2023 年 4 月 5 日

0 投票

%Let "in" be your matrix
%Finding the rows that meet this condition
idx = in(:,2) > 0.08 | in(:,2) < -0.08;
%Deletion
in(idx,:)=[];

その他の回答 (0 件)

カテゴリ

製品

リリース

R2023a

質問済み:

2023 年 4 月 5 日

回答済み:

2023 年 4 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by