Sunday 15 August 2010

Fill remainder of data set with nans in Matlab -


I have a dataset that has some measurement for a certain time period:

  Jday = 60% (60 * 24): ... Daytonum ('2011-07-31 23:00', 'Yyyy-mm-dd HH: Mm'); Dot = rand (length (jde), 1);   

Now I would like to make sure that the data set covers the entire year cycle under the given years (throughout 2010 and 2010). Therefore, given that the data is measured per hour, how can I fill with NaN in the remaining time of the dataset so that the length of the final variable is equal to:

  Jday = datenum ('2010 -01-01 00:00 ',' yyyy-mm-dd HH: MM '): 60 / (60 * 24): ... Daytonum (' 2011-12-31 23:00 ',' YYY-MM- DD HH: MM ');   

Where DAT, for example, 2011-07-31 23:00 and 2011-12-31 will be nanose in between 23:00?

If you have R2013a, then you padarray () :

  B 

Note: : If you want to take union of two sets, for example A and B, where lack of generality Without a B is included, then you have A_N and LT; = B_N & lt; A_N + 1 In which case, only the array can not be pad, but you need to fill it with NaN. In the ismember () and logical sequencing, or even accumarray () .

No comments:

Post a Comment