for loop system in simulink
조회 수: 30 (최근 30일)
이전 댓글 표시
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
댓글 수: 1
Mathieu NOE
2023년 11월 9일
hello
you can access a matrix rows or columns data several ways , but why the need for a for loop ?
답변 (1개)
SOUMNATH PAUL
2023년 11월 23일
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:
- Build a matrix block for giving input to your subsystem.
- Use “For Each Subsystem” block.
- 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.
- 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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!