Problem 60754. Extract diagonal of sparse quadratic form
Consider the matrix A and vector v given by,
A=round(sprand(5e3,1e4,1/1e4*100)*100);
v=randi(10,width(A),1);
Write a routine that will return the diagonal of the quadratic form A*diag(v)*A', and which executes on the above inputs in less than 0.03 seconds.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers4
Suggested Problems
More from this Author4
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!