MATLAB Answers

for in MATLAB Function block in Simulink

1 view (last 30 days)
Facing trouble in implementing our algorithm in Simulink which contains for loop. For loop in MATLAB Function is not running properly.
We have MATLAB code which contains for loops. For loops ain't implemented in Simulink by us.
Please help us.
Waiting for reply.

  0 Comments

Sign in to comment.

Accepted Answer

Andrey Kiselnikov
Andrey Kiselnikov on 22 Jul 2019
Edited: Andrey Kiselnikov on 22 Jul 2019
There are two right ways to solve you problem:
  1. Refactor your code with replacing loops with matrix operations https://www.mathworks.com/matlabcentral/answers/369868-how-do-i-replace-my-for-loops-using-matrix-manipulation
  2. Build your algorithms with Stateflow

  5 Comments

Show 2 older comments
HEMANT GHUGE
HEMANT GHUGE on 24 Jul 2019
Thanks Andrew Sir and Maitreyee Ma'am
Our model is good to go.
Maitreyee Mordekar
Maitreyee Mordekar on 24 Jul 2019
Hello Hemant,
That's great to hear!
All the best,
Maitreyee
Andrey Kiselnikov
Andrey Kiselnikov on 24 Jul 2019
If it was helpful you can mark answer as accepted ;)

Sign in to comment.

More Answers (0)

Sign in to answer this question.