Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------- TestClass1.m ------------------
- classdef TestClass1 < handle
- properties
- a;
- end
- methods
- function obj=TestClass1(T)
- display("Constructing instance of TestClass1")
- obj.a=T.a;
- end
- end
- end
- ------------- TestClass2.m ------------------
- classdef TestClass2 < handle
- properties
- a;
- end
- methods
- function obj=TestClass2()
- display("Constructing instance of TestClass2")
- obj.a=42;
- end
- end
- end
- ------------- objTest.m ------------------
- clear all;
- testObj2=TestClass2(); %works
- testObj1=TestClass1(testObj2); %works
- %failObj=TestClass1(testObj1); %does not work
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement