Info
This question is closed. Reopen it to edit or answer.
Constructing a sub-class efficiently
1 view (last 30 days)
Show older comments
I've created a superclass called PointGeometry. It's properties include 'X','Y', and 'Radius'. These property values correspond to points on a plane. For example,
X = [0 1 1 0] Y = [0 0 1 1] Radius = [0 0 1e-2 0]
is a box with a radius of 1e-2 on one corner.
In my constructor I have these values explicitly defined:
Constructor
methods
function pg = PointGeometry(X,Y,Weight,Radius,varargin)
I am now creating a sub-class which is a special instance of this class. Eventually it gets to a point of having these X,Y,Radius values, but a method needs to operate on these parameter values first to get it in this format.
How do I initialize the sub-class with a constructor if I've not yet determined what the X, Y, and Radius values should be for the superclass?
0 Comments
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!