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?

 Réponse acceptée

James Tursa
James Tursa le 6 Oct 2017
Modifié(e) : James Tursa le 6 Oct 2017

1 vote

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.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by