Deleting rows in a matrix by critera

조회 수: 2 (최근 30일)
aforb
aforb 2017년 9월 24일
댓글: aforb 2017년 9월 28일
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?

채택된 답변

Walter Roberson
Walter Roberson 2017년 9월 24일
SensorDate([1:dTime_records, rTime_records:end], :) = [];
  댓글 수: 1
aforb
aforb 2017년 9월 28일
Thanks Walter. This worked great and so simple.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by