Error using function block
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Kaustubha Govind
el 22 de Abr. de 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?
Respuestas (0)
Ver también
Categorías
Más información sobre Simulink Functions en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!