How can i use the output of a function block just as a gain?

2 ビュー (過去 30 日間)
Mehmet Kivanc Çelik
Mehmet Kivanc Çelik 2013 年 12 月 9 日
コメント済み: Suneesh 2013 年 12 月 10 日
Dear all,
I calculate PI parameters which are Kc, Ti in a function block. But later, I want them to use just as gain block. How can i do this? As you know, i can only use the output part of the fcn block. Can i use the calculated variable just like a gain? Thanks.

採用された回答

Suneesh
Suneesh 2013 年 12 月 9 日
Use a Multiply block from the 'Math Operations' library. One input is the signal that needs to be increased in magnitude. The other input is the gain value from the MATLAB Function block.
Please note that the multiply block is listed as 'Divide' in the library.
  2 件のコメント
Mehmet Kivanc Çelik
Mehmet Kivanc Çelik 2013 年 12 月 9 日
Suneesh, thanks for your answer. Actually, I am currently doing it by that way but it increases complexity of the model and it looks disorganized. I have wondered whether there is a more convenient way or not.
Suneesh
Suneesh 2013 年 12 月 10 日
Is there a reason you did not add an input to the function block, do the multiplication in the code within it and then produce an output signal? That was you have a custom gain block that calculates the PI parameters. You could also a mask on this block using which you could tune parameter values (like you change the gain value on a Gain block).

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAuthor Block Masks についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by