set intersection - issues with intersect in matlab -


consider following example:

time = datenum('2010-03-03 00:00','yyyy-mm-dd hh:mm'):60/(60*24):...     datenum('2010-07-31 23:00','yyyy-mm-dd hh:mm');  jday = datenum('2010-01-01 00:00','yyyy-mm-dd hh:mm'):60/(60*24):...     datenum('2010-12-31 23:00','yyyy-mm-dd hh:mm');  idx = intersect(time,jday); 

why isn't idx same size time? have thought these should identical in length seeing time portion of jday. ideas?

you create vectors using colon operator, non-integer interval. since intersect element comparisons, you're bound have inaccuracies due floating-point representation, , in case suspect it's issue. if want verify that, suggest use ismember identify members not equal (but supposed be).


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -