select certain matrix elements

2 visualizaciones (últimos 30 días)
zilai si
zilai si el 15 de Oct. de 2019
Editada: Fabio Freschi el 15 de Oct. de 2019
hello,everyone
i just want to ask how to select eg the 1-10 and 20-30 rows elements in the first column.
like A(1:10 and 20:30,1)

Respuesta aceptada

Fabio Freschi
Fabio Freschi el 15 de Oct. de 2019
Editada: Fabio Freschi el 15 de Oct. de 2019
You can simply concatenate your ranges using square brackets:
A([1:10 20:30],1)

Más respuestas (0)

Categorías

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

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by