Advertisement
RemiNital

Untitled

Apr 27th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.37 KB | None | 0 0
  1. function V = spectralradiusJacobi(a,b,step,o)
  2. % Funksjonen skriver spektralradiusene til en matrise V av
  3. % iterasjonsmatrisene i Jacobi metoden
  4. format long
  5. c = a:step:b;
  6. d = length(c);
  7. V = zeros(d,1);
  8. for i = 1:d
  9.     A = sparse(MatrixGenerator(c(i),o));
  10.     I = eye(c(i)^2,c(i)^2);
  11.     D = diag(diag(A));
  12.     V(i,1) = max(abs(eig(I-D\A)));
  13. end % for
  14.  
  15. end % function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement