Hi guys,
Is there any way to call a class into another class. If so could anyone give me a small example. I want to call the complete class with indenpendent and dependent properties
thankyou

댓글 수: 1

JAMMI ASHOK
JAMMI ASHOK 2020년 9월 24일
What do you mean by 'calling'?
You can inherit a class to another class - create an object to child class - and using that object access the parent class attributes.

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

답변 (1개)

Rik
Rik 2020년 9월 24일

0 개 추천

Here is an example from the documentation:
classdef PositiveDouble < double
methods
function obj = PositiveDouble(data)
if nargin == 0
data = 1;
else
mustBePositive(data)
end
obj = obj@double(data);
end
end
end

카테고리

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

태그

질문:

2020년 9월 8일

답변:

Rik
2020년 9월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by