필터 지우기
필터 지우기

Please, correct the following logical index in vetor.

조회 수: 2 (최근 30일)
Mariana
Mariana 2017년 11월 23일
답변: Rik 2017년 11월 23일
% Need to write the elements from 1 to ref, and from ref to n. Where n is the vector dimension.
X(1:ref && ref:n)

채택된 답변

Rik
Rik 2017년 11월 23일
What you describe just inserts 1 element into your vector. Is that what you mean?
Anyway, this is not logical indexing. If you want to do this, you can just write
X([1:ref ref:n])
Logical indexing would be something like
X(X~=ref)

추가 답변 (0개)

카테고리

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