Is it possible to extract the diagonal elements of a matrix into a vector?

Click For Summary
SUMMARY

It is possible to extract the diagonal elements of a matrix into a vector using only matrix multiplication, as discussed in the forum. The method involves a sequence of matrix multiplies and adds, focusing on isolating each diagonal element into a 1x1 matrix and then expanding it into the correct position in a vector. This approach requires careful manipulation of matrix dimensions, potentially involving matrices of order N² or N³, depending on the size of the original matrix.

PREREQUISITES
  • Understanding of matrix multiplication principles
  • Familiarity with MATLAB programming
  • Knowledge of matrix dimensions and their manipulation
  • Concept of vector representation in linear algebra
NEXT STEPS
  • Research techniques for matrix multiplication in MATLAB
  • Explore linear algebra concepts related to diagonal matrices
  • Learn about vectorization techniques in MATLAB
  • Investigate advanced matrix operations and their applications
USEFUL FOR

Mathematicians, MATLAB programmers, and anyone interested in advanced matrix manipulation techniques.

7Deuce
Messages
1
Reaction score
0
Is it possible to extract the diagonal elements of a matrix into a vector??

Is it possible to extract the diagonal elements of a matrix into a vector USING ONLY MATRIX MULTIPLICATION? So no element by element multiplication, and no diag commands.

(This will eventually be implemented in MATLAB, but I am required to only use matrix multiplication, so no commands)

Is it even possible?

Thanks in advance.
 
Physics news on Phys.org


You can do it with a sequence of matrix multiplies and adds.

Think about how to get one diagonal element into a 1x1 matrix, and then how to "expand" the 1x1 matrix into the right place in a vector. Repeat and add...

Possibly you combine all those steps part of a bigger matrix multiply operation (I'm speculating here) If the given matrix is order N, you might need matrices with dimensions of N2 or even N3...
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 33 ·
2
Replies
33
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K