How to generate a series of output from a function block ?

3 ビュー (過去 30 日間)
Vivek T S
Vivek T S 2023 年 5 月 29 日
回答済み: Nithin Kumar 2023 年 6 月 6 日
hi,
is it poosible to generate a series of output from a function block in simulink from a single input read?
the module takes an input A and generates output B0,B1,B2 as a series.I need to load these values one by one onto a connection wire between blocks(something similar to an unbuffer works).
thanks

回答 (1 件)

Nithin Kumar
Nithin Kumar 2023 年 6 月 6 日
Hi Vivek,
Yes, it is possible to generate multiple outputs from a function block in Simulink from a single input with the following steps.
  • Create a Simulink model.
  • Add a Function block and double-click to open it.
  • In the Function block window, enter the function you defined.
  • In the inputs section, add the input to the function.
  • In the outputs section, add the outputs for the function.
  • Add a Memory block to store the input value.
  • Connect the input signal to the Memory block.
  • Connect the output of the Memory block to the input of the Function block.
  • In the Function block window, write the logic to generate the series of outputs based on the input value and the output from the previous iteration.
  • Connect the outputs of the Function block to the desired output signals.
  • Save and run the model.
By using the Memory block to store the input value and the outputs generated by the Function block, you can implement the logic to generate the subsequent outputs from the previous output values.
For more information regarding the memory block, kindly refer to the following documentation.
I hope this answer helps you.

Community Treasure Hunt

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

Start Hunting!

Translated by