Multiply each column of a matrix by another matrix
Show older comments
Hi,
I have 2 matrices, E of dimension 4x57 and J of dimension 4x4.
I'm trying to do the operation C = sqrt(E'*J*E) for each column of E, so that C ends up being a vector of length 57.
Any ideas of how to do this without a loop?
Thank you very much
1 Comment
Adam
on 9 Apr 2019
E'*J*E
will result in a 57x57 matrix so what is the operation you are actually trying to achieve in ordder to get a length 57 vector?
Accepted Answer
More Answers (1)
Jon
on 9 Apr 2019
1 vote
If I understand your question correctly then the result of the "operation for each column of E" will be on the main diagonal of E'*J*E so you should get what you want using C = sqrt(diag(E'*J*E))
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!