Diagonally dominent matrix with desired condition number

3 views (last 30 days)
I have parallel code for Jacobi algorithm and I want to test it on a square large linear system(like 1600*1600). I tried with symmetric positive definite but the solution does not converge. Could help with generating a diagonally dominant matrix with desired condition number(like 1, 1000 , 10000 , 100000). I tried with this code but it does not work:
function result = matrix_jacobi(n , CondNumb )
tempA = round(1000*randn( n, n));
A= tempA + diag(sum(abs(n ),2));
[U,S,V ] = svd(A);
S(S~=0)=linspace(CondNumb , 1 , n);
result =U*S*V';

Answers (0)

Categories

Find more on Operating on Diagonal Matrices 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!