Error using function block
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a vector of around 25 signals to be seen on scope...since that is not practically feasible....I have used a masked subsystem between vector of signals and scope, with popup enabled showing me the list of all signals in the vector,....Inside the subsystem i have the f(u) block where i have written u(selected channel)..."selected channel" is the variable of the popup...output of the f(u) block is connected to scope....
But i am getting this error while running....
Input ("u") index must be a positive integer in the expression: u(Selected_Ch)
in 'System/Fcn1'
when used for code generation
vector is coming from an sfunction block...
Pls post ur suggestions
댓글 수: 2
Kaustubha Govind
2013년 4월 22일
What happens if instead of using "u(Selected_Ch)" on the Fcn block, you create a separate MATLAB function, let's say myselector which accepts u and Selected_Ch as inputs and uses a switch-case statement to return the output as u(1), u(2), u(3), and so on?
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Simulink Functions에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!