Please, correct the following logical index in vetor.

1 次查看(过去 30 天)
% 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 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by