- 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
- Build your algorithms with Stateflow
for in MATLAB Function block in Simulink
2 views (last 30 days)
HEMANT GHUGE on 22 Jul 2019
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.
Andrey Kiselnikov on 22 Jul 2019
Edited: Andrey Kiselnikov on 22 Jul 2019
There are two right ways to solve you problem: