how to flip the inputs of an simulink block

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

3 件のコメント

stalin
stalin 2014 年 8 月 27 日
編集済み: stalin 2014 年 8 月 27 日
can u give me a example
XAXRXTX
XAXRXTX 2014 年 8 月 27 日
for example the cross product block you have two inputs A & B and one output C C = AxB the question is
how to put the A letter in the place of B input ...
A in the Top and B in the bottom of the block
after the inversion of the inputs
B in the Top and A in the bottom of the block
without affectiong the output
Andy L
Andy L 2014 年 8 月 27 日
Does this need to be done based on a condition that is set during simulation?

サインインしてコメントする。

回答 (1 件)

Andy L
Andy L 2014 年 8 月 27 日

0 投票

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 件のコメント

XAXRXTX
XAXRXTX 2014 年 8 月 27 日
thanks all for replying
I think you did'n understand the question, so I want this
Star Strider
Star Strider 2014 年 8 月 27 日
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
Andy L 2014 年 8 月 29 日
XAXRXTX,
Would my solution for switching the inputs not work for your scenario then?
Star Strider
Star Strider 2014 年 8 月 29 日
You don’t need to switch the inputs. Just negate the result. It has the same effect.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeSimulink についてさらに検索

質問済み:

2014 年 8 月 27 日

コメント済み:

2014 年 8 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by