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

50.0% Correct | 50.0% Incorrect
Last Solution submitted on Nov 01, 2024

Problem Comments

Solution Comments

Show comments

Problem 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!