Advertisement
RemiNital

Untitled

Apr 27th, 2017
67
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 = spectralradiusRichardson(a,b,step,o)
  2. % Denne funksjonen regner ut spektralradiusen for iterasjonsmatrisene i
  3. % Richardson-metoden og gir ut en matrise V
  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.     V(i,1) = max(abs(eig((I\(I-A)))));
  12. end % for
  13. end % function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement