필터 지우기
필터 지우기

How to remove unwanted elements of a array

조회 수: 50 (최근 30일)
Donald
Donald 2015년 10월 14일
댓글: Hyunjung Lee 2021년 4월 21일
I have two arrays with unwanted data at the beginning and end of each array (Stress and del L). What is an easy way to remove these elements?

답변 (1개)

WAT
WAT 2015년 10월 14일
편집: WAT 2015년 10월 14일
If you want to get rid of indices 1 through 3 (for example) then
array(1:3) = [];
  댓글 수: 1
Hyunjung Lee
Hyunjung Lee 2021년 4월 21일
Thank you! I am not the original poster, but this helped me with removing array elements specified in an index vector. Before looking at your reply, I tried a(~idx,:) to try to only keep rows other than those specified by an index vector idx, but it didn't work. Thanks again!

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

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by