Cannot define a cell array of custom classes in function argument validation
I’ve a class like the following one:
classdef Session < handle
%SESSION Summary of this class goes here
% Detailed explanation goes here
properties (Access = private)
configurations (1, 🙂 cell {mustBeA(configurations, "App.Core.Configuration")}
end
methods (Access = public)
function this = Session()
this.configurations = {}
end
end
What I want to do is to declare che configuration property as a unidimensional cell array of a custom class, that can have 0 or more elements.
The problem is that I cannot instantiate it. When I try to do something like:
s = App.Core.Session()
I obtain the following error
Error using implicit default value of property ‘configurations’ of class ‘App.Core.Session’. Value must be one of the following types: ‘App.Core.Configuration’.
even if the App.Core.Configuration() class exists and it works (I’ve already unit tested it).
How can I declare correctly my configurations property?I’ve a class like the following one:
classdef Session < handle
%SESSION Summary of this class goes here
% Detailed explanation goes here
properties (Access = private)
configurations (1, 🙂 cell {mustBeA(configurations, "App.Core.Configuration")}
end
methods (Access = public)
function this = Session()
this.configurations = {}
end
end
What I want to do is to declare che configuration property as a unidimensional cell array of a custom class, that can have 0 or more elements.
The problem is that I cannot instantiate it. When I try to do something like:
s = App.Core.Session()
I obtain the following error
Error using implicit default value of property ‘configurations’ of class ‘App.Core.Session’. Value must be one of the following types: ‘App.Core.Configuration’.
even if the App.Core.Configuration() class exists and it works (I’ve already unit tested it).
How can I declare correctly my configurations property? I’ve a class like the following one:
classdef Session < handle
%SESSION Summary of this class goes here
% Detailed explanation goes here
properties (Access = private)
configurations (1, 🙂 cell {mustBeA(configurations, "App.Core.Configuration")}
end
methods (Access = public)
function this = Session()
this.configurations = {}
end
end
What I want to do is to declare che configuration property as a unidimensional cell array of a custom class, that can have 0 or more elements.
The problem is that I cannot instantiate it. When I try to do something like:
s = App.Core.Session()
I obtain the following error
Error using implicit default value of property ‘configurations’ of class ‘App.Core.Session’. Value must be one of the following types: ‘App.Core.Configuration’.
even if the App.Core.Configuration() class exists and it works (I’ve already unit tested it).
How can I declare correctly my configurations property? validation, class, cell, mustbea MATLAB Answers — New Questions
​