Please, correct the following logical index in vetor.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
% 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)
0 commentaires
Réponse acceptée
Rik
le 23 Nov 2017
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrices and Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!