Reading the matrix elements row wise
Mostrar comentarios más antiguos
Let say I have a matrix A = [1 2 3; 4 5 6], I can access its elements by writing A(1) and A(2) etc. but this index runs column wise. How to access elements of matrix row by row, for example if I write A(2), I want to get 2 and not 4.
Respuesta aceptada
Más respuestas (1)
Paul Hoffrichter
el 30 de Dic. de 2020
Editada: Paul Hoffrichter
el 30 de Dic. de 2020
A = [1 2 3; 4 5 6];
Atr = transpose(A);
Atr(1:6)
ans =
1 2 3 4 5 6
Categorías
Más información sobre Linear Algebra en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!