I have two index arrays i1 and i2 and a data array data.
I want to set the areas of data in the following way:
data([i1(1):i2(1), i1(2):i2(2)]) = ... % and so on
Is there a way to do that fast without loops? It can be achieved via
for i=1:length(d1) data(d1(i):d2(i)) = 1.0;end
Best Answer