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