Undefined function 'isPropertyPortTarget' for input arguments of type 'meta.property'.

4 visualizaciones (últimos 30 días)
Hi all,
I have been trying to find a solution for it in the forum and documentation, but haven't turned up with a solution or reference to this error.
What am I trying to do?
I am trying to create a matlab.System object named SingleAgent ( SingleAgent.m )with the following code
classdef SingleAgent < matlab.System & AgentPlant
properties
prop_1
end
methods(Access = protected)
function setupImpl(obj)
% Perform one-time calculations, such as computing constants
AgentPlant()
obj.prop_1 = 1;
end
function y = stepImpl(obj,u)
% Implement algorithm. Calculate y as a function of input u and
% discrete states.
y = u;
end
function resetImpl(obj)
% Initialize / reset discrete-state properties
end
end
end
As seen above, I am trying to inherit a handle object named AgentPlant which I am instantiating within the stepImpl() of the SingleAgent.
The definition of the AgentPlant - handle object (in AgentPlant.m) is as follows:
classdef AgentPlant < handle
properties
action_matrix
operation_time
current_activity
end
properties(Constant)
EMPTY = -9999
act_queue_size = 10;
end
methods
function obj = AgentPlant()
obj.operation_time = 0;
end
end
end
I am trying to add the matlab.System object within Simulink (I am attaching the Simulink file which does this, if it helps). However, I am not able to do it and I get the error as defined in the summary. I am also attaching the screen-shot and files associated with this error I am facing.
Please let me know if anyone in the community has faced this error before, and if so how did you manage to resolve it?
Looking forward to your comments. Thank you!

Respuestas (1)

Murali
Murali el 16 de Oct. de 2021
I played around with the Access properties of the attributes of the handle object and figured that it only works if the attributes without an initial value needs to have Access = protected.
Is there any documentation out there which specifies what these quirks are about these MATLAB?

Categorías

Más información sobre Create System Objects en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by