Info
此问题已关闭。 请重新打开它进行编辑或回答。
Constructing a sub-class efficiently
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!