Syntax error in Simulink
    조회 수: 3 (최근 30일)
  
       이전 댓글 표시
    
I am getting a syntax error in Simulink in a Fcn block:
c1*(c2/u[2]-c3*u[3]-c4)*exp(-c5/u[2])+c6*u[1]
댓글 수: 0
답변 (1개)
  Geetla Sindhu
    
 2022년 11월 11일
        Hello Nibash,
I understand that you are getting syntax error while using MATLAB function block in Simulink.
The cause of this error is the use of square brackets [ ] for indexing the input vector. Instead, you can try using the following syntax to solve the issue.
function y = fcn(u)
y = c1*(c2/u(2) – c3*u(3) – c4)*exp(-c5/u(2)) + c6*u(1);
end
Hope this resolves your issue.
Thank you.
댓글 수: 0
참고 항목
카테고리
				Help Center 및 File Exchange에서 Foundation and Custom Domains에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

