Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. classdef MyClass < handle
  2.  
  3. properties
  4.  
  5. % big matrices
  6. M1; %sparse
  7. M2;
  8. M3;
  9.  
  10. end %properties
  11.  
  12. methods
  13.  
  14. function obj = MyClass(...)
  15. ...
  16. obj.InitializeM1(...);
  17. obj.CreateM2(...);
  18. ...
  19. end
  20.  
  21. function Heavy(obj)
  22. ....
  23. for i=1:N
  24. obj.M3(:,i) = obj.UseM1(obj.M2(:,i))
  25. end
  26.  
  27. end % Heavy
  28.  
  29. function out = UseM1(in)
  30. %....
  31. end % UseM2
  32.  
  33. end % methods
  34.  
  35. end % MyClass
  36.  
  37. parfor i=1:N
  38. tmp(:,i) = UseM2(obj,obj.M2(:,i))
  39. end
  40. obj.M3 = tmp;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement