Array variable as parameter value in simulink

6 views (last 30 days)
Hi,
I have an 1-D array (ex: A) with a size exactly matching that of the total simulation steps. This array can be either stored in model or base workspace.
I need to set a block parameter to A(Index) with its index changing according to the simulation time.
How can I do this?
Thank you for your help.

Accepted Answer

Paul
Paul on 16 Jan 2022
Use a Selector block. Choose the 'Index option' as 'Index vector - port'. Then connect A to the U port and feed the Indx1 port with an integer that you develop from the the simulation time.
  3 Comments
Sridhar Balasubramanian
Sridhar Balasubramanian on 16 Jan 2022
Thank you.. I used set_param to update A(Index) in my block.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!