I have created a class in which I am able to autocode everthing except the list of strings I have just added to the system. Right now I have defined the class similar to the following:
classdef MyClass < handle
properties (SetAccess = private)
% Internal data structure
idCnt = uint64(0);
stringType = coder.typeof('string', [1,Cnst.MaxNum]);
numItems = zeros(1,1,'uint32');
id = zeros(Cnst.MaxNum,1,'uint64');
end % properties private
function [myValues] = myFunction(T, MyInputs)
for k = 1:int32(T.numItems)
MyNewString(k).stringType = T.stringType(k);
When I attempt to use the coder to auto-code, I get the following error:
Code generation only supports initial values of class type for constant properties. Property 'stringType' of class 'MyClass' is not constant.
Can you help me with this so I can get this in a state where it will auto-code?