Info

此问题已关闭。 请重新打开它进行编辑或回答。

Constructing a sub-class efficiently

1 次查看(过去 30 天)
Wade
Wade 2012-7-16
关闭: MATLAB Answer Bot 2021-8-20
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 个)

此问题已关闭。

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by