Clear Filters
Clear Filters

Addition of specified array indexes in simulink

2 views (last 30 days)
I am having some problems whentrying to achieve what seems to be a simple for loop with simulink. The loop I want to acheive is something like:
myArray = [1,2,3,4,3,2,3,4,5,6,7] % example
startIndex = 3
endIndex = 5
% Actual loop
total = 0
for c = startIndex:1:endIndex
total += myArray(c)
Any guidance on how could this behaviour be achieved in simulink?

Accepted Answer

madhan ravi
madhan ravi on 11 Dec 2018

More Answers (0)


Find more on Programmatic Model Editing in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!