How is this simple code read?

My code is as follows :
mat = [1 2 3 ; 4,5,6 ; 7 8 9];
mat([2 3], [2 3])
Question: Why is the output
5 6
8 9
and how is that determined?

 Respuesta aceptada

James Tursa
James Tursa el 6 de Oct. de 2017
Editada: James Tursa el 6 de Oct. de 2017

1 voto

It is the 2nd & 3rd rows and the 2nd & 3rd columns of the matrix mat. The syntax is simply extracting a sub-matrix of the original.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 6 de Oct. de 2017

Editada:

el 6 de Oct. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by