Azzera filtri
Azzera filtri

for loop system in simulink

5 visualizzazioni (ultimi 30 giorni)
Laura Festa
Laura Festa il 9 Nov 2023
Risposto: SOUMNATH PAUL il 23 Nov 2023
how can use the for loop in Simulink in order to scrollin through the different row of a matrix?
i'm trying to evaluate the different result of linear equations where my values are in vector and in matrix.
thank you in advance

Risposte (1)

SOUMNATH PAUL
SOUMNATH PAUL il 23 Nov 2023
Hi,
As per my understanding, you want to use for loop iterator for going through the different rows of a matrix which allows you to evaluate linear equations for each row of the matrix.
Here are some suggestions that you can follow to implement the iterator:
  1. Build a matrix block for giving input to your subsystem.
  2. Use “For Each Subsystem” block.
  3. Connect the input to the above-mentioned block and go through the first link to understand how you can iterate over rows and columns based on your specific requirements.
  4. Place the blocks that models your linear equations inside the “For Each Subsystem” and then use the input from the block as the current row or column of your matrix.
Kindly refer to the section ”Configure the Subsystem” in the link below to get an idea of how to operate vectors and matrices using this block:
Here’s an example in SIMULINK to implement partitioning input:
You can also use the block “For Iterator Subsytem” but you must explicitly specify the number of iterations every time you use this.
Hope it helps!
Regards,
Soumnath

Community Treasure Hunt

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

Start Hunting!

Translated by