Advertisement
RemiNital

Untitled

Apr 27th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.74 KB | None | 0 0
  1. function sim = spectralradiusSORfile(a,b,step)
  2. % Denne funksjonen skriver data til seks filer som allerede er bestemt på
  3. % forhånd, av hvor mange verdier mellom 0 og 4pi^2 vi vil ta.
  4. format long
  5. c = a:step:b;
  6. d = length(c);
  7. e = 0.2:0.2:1.8;
  8. f = length(e);
  9. V = zeros(f,d);
  10. fid1 = fopen('SOR1.asc','w');
  11. fid2 = fopen('SOR2.asc','w');
  12. fid3 = fopen('SOR3.asc','w');
  13. fid4 = fopen('SOR4.asc','w');
  14. fid5 = fopen('SOR5.asc','w');
  15. fid6 = fopen('SOR6.asc','w');
  16. fid = [{'SOR1.asc'},{'SOR2.asc'},{'SOR3.asc'},{'SOR4.asc'},{'SOR5.asc'},{'SOR6.asc'}];
  17. g = (4*pi^2)/6:(4*pi^2)/6:(4*pi^2);
  18. h = length(g);
  19. for i = 1:h
  20. V = spectralradiusSOR(a,b,step,0.2,1.8,0.2,g(i));
  21. dlmwrite(fid{i},V,'precision','%.40f');
  22. end % for
  23. sim = fclose('all');
  24. end % function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement