|
In article <f8qkc5$pka$1@fred.mathworks.com>,
Steve <steveDEL.bachmeierDEL@yahoo.com> wrote:
>Now I need to take the 'tdst' values (daylight saving times) and
>subtract 1 - but only between the dates/times 2:00 AM on the second
>Sunday in March and 2:00 AM on the first Sunday in November. The
>problem is that these datenums change, and so I'm currently trying to
hunt down the dates using something like
>for time=t'
>march{time}=calendar(year(time),3);
>november{time}=calendar(year(time),11);
>startDSTloc=march(find(min(march(:,1)>0))+1,1);
>endDSTloc=november(find(min(november(:,1)>0)),1);
>end
I'm not sure what t is here, and I suspect you want startDSTloc
and endDSTloc to be indexed by {time} . And since you are going
over multiple years, you need to take into account that the rules
changed this year.
>Then I'd somehow specifiy tstd=tdst-1 only for tdst between '3/march(startDSTloc,1)/year 2:00AM' and '11/november(endDSTloc,1)/year 2:00AM'.
Once you have figured out the appropriate start and stop times,
datenum() them, and then the positions that need to be changed
are the ones whose datenum() fall between the two values.
--
"law -- it's a commodity"
-- Andrew Ryan (The Globe and Mail, 2005/11/26)
|