Deleting rows in a matrix by critera

2 Ansichten (letzte 30 Tage)
aforb
aforb am 24 Sep. 2017
Kommentiert: aforb am 28 Sep. 2017
I am new at Matlab so please bare with me,
I am trying to figure out how to delete rows in a matrix that are outside of my criteria. I have a matrix of 176,312 records. I have been able to identify the row numbers that I would like to delete. To start I have
dTime_records = 467
rTime_records = 176216
my matrix name is SensorDate and is a 176,312 x 1 double
I want to delete all records in rows 1 to 467 and 176216 to 176312
How do I accomplish this?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 24 Sep. 2017
SensorDate([1:dTime_records, rTime_records:end], :) = [];
  1 Kommentar
aforb
aforb am 28 Sep. 2017
Thanks Walter. This worked great and so simple.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Operators and Elementary Operations finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by