Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

Adding values to an Flagged Event index in for loop

1 view (last 30 days)
MustangManiac
MustangManiac on 27 Jul 2018
Closed: Stephen23 on 27 Jul 2018
Hi - Basic question but I'm trying to create event flags in a loop. So each time an event occurs it iterates my variable. this is an example I just wrote, but basically I have a large For loop that will loop DataSet (i) thousands of times. However when it's in an 'event state' I want to iterate my EventTotal(k) + 1, then keep adding the values of my DataSet(i) until the event is over. Then the next Event would iterate my EventTotal again and repeat the process
if true
for (i = 100)
if (EvenFlag = True)
k = k + 1;
EventTotal(k) = DataSet (i) + EventTotal (k)
end

Answers (0)

This question is closed.

Community Treasure Hunt

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

Start Hunting!