Please, correct the following logical index in vetor.

6 ビュー (過去 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 Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by