Error using function block

1 vue (au cours des 30 derniers jours)
Shyam
Shyam le 20 Avr 2013
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 commentaires
Shyam
Shyam le 21 Avr 2013
It works well in normal mode but error (that is shown above) pops up in accelerator mode
Kaustubha Govind
Kaustubha Govind le 22 Avr 2013
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?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Simulink Functions dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by