Codegen complaining about cell-array assignement

Hello,
I am trying to generate a MEX file from my code, but I can't seem to figure out why codegen reports this error. I've tried to work around the problem in several ways but nothing seems to work. What i'm trying to do is constructing a cell array which entries are cells themselves.
Specifically, codegen says the following:
"every cell-array element contained in 'allvalues' (must) be assigned ... Check assignements to element(s) allvalues{:},allvalues{:}{1,1} ... allvalues{:}{1,4}."
The code is the following:
function rehash(obj)
allkeys=getkeys(obj);
%Get all values
allvalues=dim_singleton_cell(length(allkeys));
for j=1:size(allvalues,1)
%Get all values
[temp,~]=get(obj,allkeys(j));
allvalues{j}=temp;
end
newcapacity=ceil(2*obj.capacity);
obj.capacity=newcapacity;
clear(obj);
%Rehash
putAll(obj,allkeys,allvalues);
end
allvalues is a {N,1} cell array (the coder.Type is [Inf x 1] ) where each entry is a {1x4} cell array (coder.Type is [1x4]). The function dim_singleton_cell creates a {N,1} cell array with entries {int32(-1),...,int32(-1)}.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Input Specification에 대해 자세히 알아보기

질문:

2020년 4월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by