hi everybody, i got a probally simple question but would be gratefull if anyone could help
i got the following code (that does not work)
classdef Knot properties x y end % properties
methods function K = Knot(x,y) K.x=x; K.y=y; end%functions
end%methods
end %class
classdef Slab<Knotproperties Material StartKnot EndKnotenend%properties
methods function S = Slab(StartKnot,EndKnot) S.StartKnot = StartKnot; S.EndKnot = EndKnot; end%function
end%methodsend%class
in my mind the subclass Slab should get the properties x and y.
trying to run it gives me this:
>> k1 = Knoten(1,1);>> k2 = Knoten(2,2);>> s= Stab(k1)??? Input argument "x" is undefined.Error in ==> Knoten>Knoten.Knoten at 8 K.x=x;Error in ==> Stab>Stab.Stab at 8 function S = Stab(StartKnoten)
acctually i wanted to get a Slab class that has the properties of Knot and could be acceses like this:
k=Knot(1,1);kk = Knot(1,2);S = Slab(k1,k2);
Slab.StartKnot.x should deliver the x propertie of Knot
obviously i got something wrong
thankfull for help
Best Answer