"Structure field undefined on some execution paths" error when copying data between cell arrays
Ältere Kommentare anzeigen
I am trying to generate C code for a simple function with MATLAB Coder. This function defines a structure "out" and includes the following code:
if ~isempty(data)
date=cell(length(data),1);
for i=1:length(data)
date{i,1} = data{i,1};
end
out.date=date;
end
I get the following error message during code generation runtime issue check stage:
"Structure field 'out.date{:}' is undefined on some execution paths."
My function is written in a way such that this field should always be defined. Why is this error occurring, and how can I work around it?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Manage Products finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!