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 Center および File ExchangeSimulink Functions についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by