"ALEX" wrote in message <email@example.com>... > I'M BAFFLED BY THIS, I HAVE ROUNDED TWO SEPARATE COLUMNS FROM TWO DIFFERENT MATRICES. I WANT TO MATCH AN ELEMENT FROM ONE COLUMN WITH AN ELEMENT FROM A DIFFERENT COLUMN. THESE ARE NUMBERS WHICH HAVE BEEN ROUNDED TO THE TENTH. FOR SOME REASON THE IF STATEMENT ONLY ADDRESSES HAVE OF THE NUMBERS WHICH ARE IDENTICAL. NOT SURE WHY IT IS DOING THIS. ANY IDEAS? > > FOR BACKGROUND, I WANT TO MATCH THE TIMESTAMP FROM TWO DIFFERENT SETS OF DATA. ONE DATA SET IS AT 1/10 SEC INTERVALS, THE OTHER IS 2/10 SEC INTERVALS. > > THANKS SO MUCH
No need to shout!
Even though the numbers appear to be rounded to the tenths, MATLAB cannot represent & store the number EXACTLY to the tenths. (Its not MATLAB's fault, thats simply a limitation of computers internally using binary numbers.)
For a more detailed explaination and a work-around see Q5.1 of the MATLAB FAQ: