Remove rows from matrix based on condition

47 次查看(过去 30 天)
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
%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 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by