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

4 views (last 30 days)
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

Answers (1)

Nithin Kumar
Nithin Kumar on 6 Jun 2023
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.

Products

Community Treasure Hunt

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

Start Hunting!