필터 지우기
필터 지우기

I use matlab function block in simulink and got some error (Function 'MATLAB Function' (#56.9.19), line 1, column 10: "P_BESS_dis") which I couldn't fix it. Here is my code;

조회 수: 2 (최근 30일)
function P_BESS_dis = fcn(SoC,P_BESS_ref)
SoC_max=0.55;
SoC_min=0.1;
if(SoC>=SoC_max)
P_BESS_dis=0;
else
if(SoC>=SoC_min && SoC<SoC_max)
P_BESS_dis=P_BESS_ref;
end
else
if(SoC<SoC_min)
P_BESS_dis=0;
end
end
end
  댓글 수: 2
Surya Talluri
Surya Talluri 2020년 10월 20일
편집: Surya Talluri 2020년 10월 20일
With the code you have mentioned, I am not getting error at the first line. I am only getting error at "line 10, column 9" which is at the first end that you have mentioned (which is not needed). You can remove that end and by initialising P_BESS_dis before the if statement, the code runs without any error.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Subsystems에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by