Borrar filtros
Borrar filtros

Please, correct the following logical index in vetor.

1 visualización (últimos 30 días)
Mariana
Mariana el 23 de Nov. de 2017
Respondida: Rik el 23 de Nov. de 2017
% 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)

Respuesta aceptada

Rik
Rik el 23 de Nov. de 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)

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by