OOP: matlab class as a property of another class
显示 更早的评论
Hi, I'm a newbie to matlab. The class individual as follows has a property named Genotype. I need this property to be another class which would have some other properties a constructor and functions. The property Genotype should correspond to the class genotype.
This can be easily achieved in other OO languages as java or c++ since they are type constrained. I don't understand how to do this with matlab. Any help would be appreciated
classdef Individual
properties
Genotype
end % properties
methods
function
end % function
end % methods
end % classdef
classdef Genotype
properties
X
Y
Z
end % properties
methods
function
end % function
end % methods
end % classdef
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Function Creation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!