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

11 Solutions

6 Solvers

Last Solution submitted on Apr 24, 2026

Last 200 Solutions

Problem Comments

Solution Comments

Show comments
Loading...

Problem Recent Solvers6

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!