Inheritence scope problem with superclass timeseries

Hi, I have a subclass inherited from timeseries who is named "Interpolable". I would like to extends the classname timeseries to add some properties and methods to it. In my "Interpolable" constructor (with no parameters), I instanciated the constructor of the superclass with no properties too: obj = obj@timeseries(). In a sub methods named: function initializeX(obj, Data, Time), the superclass are initiated with a vector of data and time like that: "obj.Data = Data" and "obj.Time = Time". The problem is that the initializeX returns me a new timeseries and don't memorize the new data within the object. What should I do?

댓글 수: 1

Stephane
Stephane 2013년 10월 28일
편집: Stephane 2013년 10월 28일
classdef Interpolable < timeseries
methods
function obj = Interpolable()
obj = obj@timeseries();
end
function initx(obj,Data, Time)
obj.Data = Data;
obj.Time = Time;
end
end
end

댓글을 달려면 로그인하십시오.

답변 (1개)

per isakson
per isakson 2013년 12월 7일

0 개 추천

That's because timeseries is a value class. See Comparing Handle and Value Classes

카테고리

도움말 센터File Exchange에서 Time Series에 대해 자세히 알아보기

제품

질문:

2013년 10월 28일

답변:

2013년 12월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by