Extract diagonal of sparse quadratic form - MATLAB Cody - MATLAB Central

Problem 60754. Extract diagonal of sparse quadratic form

Difficulty:Rate
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
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
3

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!
Go to top of page