Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. classdef subClass < superClass
  2. properties (Access = public)
  3. arg1 = 1
  4. end
  5.  
  6. methods
  7. function obj = subClass(arg1)
  8. obj@superClass(arg1);
  9. end
  10. end
  11. end
  12. classdef superClass
  13. properties (Access = protected)
  14. arg2
  15. end
  16.  
  17. methods
  18. function obj = superClass(local_arg1)
  19. switch local_arg1
  20. case 1
  21. obj = functionA();
  22. otherwise
  23. obj = functionB();
  24. end
  25. end
  26. end
  27. end
  28. function obj = functionA(obj)
  29. obj.arg2 = 1;
  30. end
  31. function obj = functionB(obj)
  32. obj.arg2 = 2;
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement