Problem with 'Logical indexing requires support of variable-sized arrays, which is currently disabled'
이전 댓글 표시
Hello Dears,
I have written the below code in .m file and it was OK. But for one part of my work, I should put it in Embedded function in SIMULINK, and as i run it this error appears. I would be appreciated if anybody can help me.
for j=1:5
if j==1 && pmuA9 >=0 && pmuA8 >=0 && pmuA7 >=0 && pmuA6 >=0 && pmuA5 >=0 && pmuA4 >=0 && pmuA3 >=0 && pmuA2 >=0 && pmuA1 >=0
summuA_Q1=muA_9(j)+muA_8(j)+muA_7(j)+muA_6(j)+muA_5(j)+muA_4(j)+muA_3(j)+muA_2(j)+muA_1(j);
sumEyimuA_Q1=EyimuA_9(j)+EyimuA_8(j)+EyimuA_7(j)+EyimuA_6(j)+EyimuA_5(j)+EyimuA_4(j)+EyimuA_3(j)+EyimuA_2(j)+EyimuA_1(j);
yPFLS_Q1=(sumEyimuA_Q1)/(summuA_Q1);
yPFLS_Q1(isnan(yPFLS_Q1))=0;
PyQ1=[PmuA_9(j) PmuA_8(j) PmuA_7(j) PmuA_6(j) PmuA_5(j) PmuA_4(j) PmuA_3(j) PmuA_2(j) PmuA_1(j)];
PyQ1nonZERO=nonzeros(PyQ1);
PyQ1nonZERO(isempty(PyQ1nonZERO))=0;
PyPFLS_Q1=max(PyQ1nonZERO);
end
end
The error is:
Logical indexing requires support of variable-sized arrays, which is currently disabled.
Function 'Embedded MATLAB Function' (#22.38943.38960), line 910, column 23:
"isnan(yPFLS_Q1)"
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!