# Simulink Matlab Function - Using Cell Problem

5 views (last 30 days)
delil codes on 26 Apr 2021
Commented: delil codes on 1 May 2021
I coded all functions in m file, its works clearly in normal file, But when I want to use Simulink there is a problem like:
Unable to determine that every element of 'l_manLinkMatSkewSymm{1}{:}' is assigned before this line.
I did not understand the problem. The problem is on line 4 from the end.
Unable to determine that every element of 'l_manLinkMatSkewSymm{1}{:}' is assigned before this line. More informationFunction 'MATLAB Function1' (#63.1776.1804), line 77, column 16: "l_manLinkMatSkewSymm{k}{i,i}" Launch diagnostic report.
Component: MATLAB Function | Category: Coder error
Errors occurred during parsing of MATLAB function 'untitled/MATLAB Function1'
Component: MATLAB Function | Category: Coder error
Errors occurred during parsing of MATLAB function 'untitled/MATLAB Function1'
Component: Simulink | Category: Model error
% % % % % % % Matlab Function Codes Built in Simulink, Lauches here
skewSymm =@ (x)[0 -x(3) x(2); x(3) 0 -x(1); -x(2) x(1) 0];
p_maniNum = 2;
dof = cell(p_maniNum,1);
dof{1} = 7;
dof{2} = 5;
PHI_manPropMat = cell(p_maniNum,1);
for i = 1:p_maniNum
PHI_manPropMat{i} = cell(dof{i},dof{i});
end
for k = 1:p_maniNum
for i = 1:dof{k}
for j =1:dof{k}
PHI_manPropMat{k}{i,j} = zeros([6 6]);
end
end
end
for i = 1:p_maniNum
end
for k = 1:p_maniNum
for i =1:p_maniNum
end
end
When I remove that line that have problem on it, system works fine.
delil codes on 1 May 2021
There is problem with; {i,i}
there is no;
I did not try it but. I think this is the problem.