Adding values to an Flagged Event index in for loop

1 次查看(过去 30 天)
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by