How to select specific entries of a matrix?
Afficher commentaires plus anciens
Let the matrix A be
A=[a_11 a_12 a_13 a_14;a_21 a_22 a_23 a_24;a_31 a_32 a_33 a_34; a_41 a_42 a_43 a_44];
how to select the following entries
a_12, a_14, a_21, a_23, a_32, a_34, a_41, a_43
In general, how to select the entries in the above pattern for large size of matrix.
The above entries can be obtaind by
for odd rows and even columns
B=A(1:2:end,2:2:end)
for even rows and odd columns
C=A(2:2:end,1:2:end)
but I want the combine results of B and C i.e.,
Ans1=[a_12 a14;a_21 a_23;a_32 a_34;a_41 a_43]
Ans2=[a_12 a14;a_23 a_21;a_32 a_34;a_43 a_41]
how can we obtained Ans 1 and Ans 2 for large square matrix.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Resizing and Reshaping Matrices 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!