how to flip the inputs of an simulink block
Mostrar comentarios más antiguos
Hi everyone
I have an integrator block, and I want to invert its inputs, so I explain
the first input is x the signal to be integrated (the top input)
the second input is y the initial condition (the bottom input)
I want that x became the bottom input and y the top input
thanks in advance
Respuestas (1)
Andy L
el 27 de Ag. de 2014
0 votos
See the image below. A variable switches the input on the switch blocks - see switch for information on setting the input conditions. In this figure the input is switched by a constant but you could replace that to suit your needs (a signal generator for example).
So in this example whilst the switch variable is not greater than 0, input 1 is A, and 2 is B. When it is, these swap, A becoming the input to 2, and B becoming the input to 1.

4 comentarios
XAXRXTX
el 27 de Ag. de 2014
Star Strider
el 27 de Ag. de 2014
The output differs only by sign if A and B are reversed, so simply negate the output if you want the inputs reversed.
Non-Simulink example:
A = randi(50, 1, 3);
B = randi(50, 1, 3);
CAB = cross(A,B);
CBA = cross(B,A);
Andy L
el 29 de Ag. de 2014
XAXRXTX,
Would my solution for switching the inputs not work for your scenario then?
Star Strider
el 29 de Ag. de 2014
You don’t need to switch the inputs. Just negate the result. It has the same effect.
Categorías
Más información sobre General Applications en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
