clear all data = rand(8760,1); n=366; time=linspace(1+1/24,n,(n-1)*24)'; %day of year daylims = ([100,300]); [row1]=find(time > daylims(1) & time < daylims(2)); From the example above I'm trying to select the data for e period given by 'daylims' and then fit that data into a vector which corresponds to 'time'. Having found the row number for the data which I need, all I'm trying to do now is to surround the 'data' with nans e.g. first row is 2377 so then I want to make row 1:2377 as nan and as the last row is 7175 so I want to make row 7175:end as nan (end is 8760).
This can easily be done by moving the values around manually but I was hoping of a more efficient method. Let me know if I'm not clear.