Вот рабочий пример:
classdef ProjectTable
properties (GetAccess = ?AllProjectTables)
Value
end
methods
function obj = ProjectTable(val)
obj.Value = val;
end
function r = addTwo(obj)
r = obj.Value + 2;
end
end
end
classdef AllProjectTables
properties
Project_Table
end
methods
function obj = AllProjectTables(project_table)
obj.Project_Table = project_table;
end
function r = test(obj)
r = obj.Project_Table.Value;
end
end
end
И тест:
>> a=ProjectTable(45)
a =
ProjectTable with no properties.
>> a.Value
You cannot get the 'Value' property of ProjectTable.
>> b=AllProjectTables(a)
b =
AllProjectTables with properties:
Project_Table: [1x1 ProjectTable]
>> b.test
ans =
45
>> b.Project_Table.Value
You cannot get the 'Value' property of ProjectTable.
>>
Можете ли вы дать более подробную информацию о том, что не работает? См. Ответ ниже для рабочего примера. – zeeMonkeez