Prev: Mass-Spring-Damper. Index exceeds Matrix Dimensions.
Next: Wiener deconvolution noise artifacts & noise removal
From: enviro on 14 Mar 2010 22:53 Dear All; Please see input and output(what I wish to get).Please see also what I tried so far. But thers seems to be a problem. Could someone please help me? Thanks in advance --------------------------------------------- [m,~] = size(input); output=datenum(input(:,1),'dd/mm/yyyy HH:MM:SS'); for i=1:m; for j=i+1; break if output(j,1)<output(i,1); output(j,1)=datenum(input(j,1),'mm/dd/yyyy HH:MM:SS'); end end end output2 = datestr(output,'dd/mm/yyyy HH:MM:SS'); ---------------------------------------------- input={ '30/11/2006 06:00:00' '30/11/2006 07:00:00' '30/11/2006 08:00:00' '30/11/2006 09:00:00' '30/11/2006 10:00:00' '30/11/2006 11:00:00' '12/01/2006 00:00:00' '12/01/2006 01:00:00' '12/01/2006 02:00:00' '12/01/2006 03:00:00' '12/01/2006 04:00:00' '12/01/2006 05:00:00' '12/01/2006 06:00:00' '12/01/2006 07:00:00' '12/01/2006 08:00:00' '12/01/2006 09:00:00' '12/01/2006 10:00:00' '12/01/2006 11:00:00'}; output={ '30/11/2006 06:00:00' '30/11/2006 07:00:00' '30/11/2006 08:00:00' '30/11/2006 09:00:00' '30/11/2006 10:00:00' '30/11/2006 11:00:00' '01/12/2006 00:00:00' '01/12/2006 12:00:00' '01/12/2006 02:00:00' '01/12/2006 03:00:00' '01/12/2006 04:00:00' '01/12/2006 05:00:00' '01/12/2006 06:00:00' '01/12/2006 07:00:00' '01/12/2006 08:00:00' '01/12/2006 09:00:00' '01/12/2006 10:00:00' '01/12/2006 11:00:00'};
From: enviro on 15 Mar 2010 01:26 Any suggestions?
From: ade77 on 15 Mar 2010 14:44 enviro <farhadnejadkoorki(a)yahoo.co.uk> wrote in message <809613694.382032.1268645232157.JavaMail.root(a)gallium.mathforum.org>... > Any suggestions? Envivo, Can you just post the input and expected output(the correct output you want) of your problem, and forget about your code for a moment. it is confusing what you are doing. It seems the your data is changing from UK regional time to US regional time which is common with some logger programs.
From: ade77 on 15 Mar 2010 15:26 > Please see input and output(what I wish to get).Please > > input={ > '30/11/2006 06:00:00' > '30/11/2006 07:00:00' > '30/11/2006 08:00:00' > '30/11/2006 09:00:00' > '30/11/2006 10:00:00' > '30/11/2006 11:00:00' > '12/01/2006 00:00:00' > '12/01/2006 01:00:00' > '12/01/2006 02:00:00' > '12/01/2006 03:00:00' > '12/01/2006 04:00:00' > '12/01/2006 05:00:00' > '12/01/2006 06:00:00' > '12/01/2006 07:00:00' > '12/01/2006 08:00:00' > '12/01/2006 09:00:00' > '12/01/2006 10:00:00' > '12/01/2006 11:00:00'}; > > > output={ > '30/11/2006 06:00:00' > '30/11/2006 07:00:00' > '30/11/2006 08:00:00' > '30/11/2006 09:00:00' > '30/11/2006 10:00:00' > '30/11/2006 11:00:00' > '01/12/2006 00:00:00' > '01/12/2006 12:00:00' > '01/12/2006 02:00:00' > '01/12/2006 03:00:00' > '01/12/2006 04:00:00' > '01/12/2006 05:00:00' > '01/12/2006 06:00:00' > '01/12/2006 07:00:00' > '01/12/2006 08:00:00' > '01/12/2006 09:00:00' > '01/12/2006 10:00:00' > '01/12/2006 11:00:00'}; my mistake, I see you already post the input and expected output. Can you explain the logic here: input: '12/01/2006 00:00:00' '12/01/2006 01:00:00' '12/01/2006 02:00:00' '12/01/2006 03:00:00' output: '01/12/2006 00:00:00' '01/12/2006 12:00:00' '01/12/2006 02:00:00' '01/12/2006 03:00:00' obviously,the months and days are switched, but how about the hour, minute and day, what is the relationship? input{'12/01/2006 01:00:00'} and output{'01/12/2006 12:00:00'} is the only discrepancy I can not figure out.
From: enviro on 15 Mar 2010 22:31
hour, minute, seconds are constant. But the month and day have beed replaced for instance from row 7 and I want to maket them identical to rows 1 to 7. Please see input and the output I wish to get. Input={ '30/11/2006 18:00:00' '30/11/2006 19:00:00' '30/11/2006 20:00:00' '30/11/2006 21:00:00' '30/11/2006 22:00:00' '30/11/2006 23:00:00' '12/01/2006 00:00:00' '12/01/2006 01:00:00' '12/01/2006 02:00:00' '12/01/2006 03:00:00' '12/01/2006 04:00:00' '12/01/2006 05:00:00' '12/01/2006 06:00:00' '12/01/2006 07:00:00' '12/01/2006 08:00:00' '12/01/2006 09:00:00' '12/01/2006 10:00:00' '12/01/2006 11:00:00' }; output={ '30/11/2006 18:00:00' '30/11/2006 19:00:00' '30/11/2006 20:00:00' '30/11/2006 21:00:00' '30/11/2006 22:00:00' '30/11/2006 23:00:00' '01/12/2006 00:00:00' '01/12/2006 01:00:00' '01/12/2006 02:00:00' '01/12/2006 03:00:00' '01/12/2006 04:00:00' '01/12/2006 05:00:00' '01/12/2006 06:00:00' '01/12/2006 07:00:00' '01/12/2006 08:00:00' '01/12/2006 09:00:00' '01/12/2006 10:00:00' '01/12/2006 11:00:00' }; |