Hi, I have a loop that starts with
for t = window:offset:numel(m);
However, I would like the "offset" value to be dynamic and adjust after each loop by:
offset=0; for i = x:numel(m); if m(i,:) == true; for x = i+1:numel(m); if m(x,:) == false; offset = offset+1; else offset=offset+1; break, end end else break; end end
In this case, "m" is a vector of logical values where "1" is a monthly break. Hence, "offset" is the number of (in this case) trading days for each month.
Any suggestion of how I could accomplish this?
Many thanks, Sten
Best Answer