Error using function block

1 次查看(过去 30 天)
Shyam
Shyam 2013-4-20
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 个评论
Shyam
Shyam 2013-4-21
It works well in normal mode but error (that is shown above) pops up in accelerator mode
Kaustubha Govind
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 CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by