Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Constructing a sub-class efficiently

1 visualización (últimos 30 días)
Wade
Wade el 16 de Jul. de 2012
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
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?

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by