Remove rows from matrix based on condition

조회 수: 40 (최근 30일)
Zahra
Zahra 2023년 4월 5일
답변: Dyuman Joshi 2023년 4월 5일
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