Pass existing object to different class objects
4 次查看(过去 30 天)
显示 更早的评论
Hi I have a object oriented programm so simulate different appliances.
I have a class object where the general settings of my programm are stored, so I don't have to save a lot of datas to every objec
If I store the object of my settings in the other object, do I generate everytime a "new" settingsobject and use a lot of space or will it be just a "pointer" to my existing object?
classdef appliance
properties
gens
% ...
end
methods
function obj = timeClass(gens)
%UNTITLED Construct an instance of this class
obj.gens = gens
end
% ...
end
end
gens = generalClassObject
appli = appliance(gens)
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Properties 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!