Filter löschen
Filter löschen

Remove rows from matrix based on condition

45 Ansichten (letzte 30 Tage)
Zahra
Zahra am 5 Apr. 2023
Beantwortet: Dyuman Joshi am 5 Apr. 2023
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).

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by