Interp1 is not working after applying unique because of rounding off
I have a double array with many values. The first value is 3.569990000000001, the next multiple values is 3.570000000000001, then comes 3.570010000000001 and it works like this. I can see only these long values which i click on that cell, otherwise every value is being displayed as 3.57. Now I applied unique, so the multiple 3.570000000000001 is removed and there is now only one 3.570000000000001 and again and so on, but still all values are seen as 3.57. So if compared the first two values to see if it equal it is showing that they are not equal even though me as the user sees both values as 3.57. Now here comes the problem. I need to use interp1 on these values, but here interp1 is not reading them as 3.569990000000001 and 3.570000000000001. Interp1 is reading both of them as 3.57 and is giving me an error saying values need to be unique. I dont know what to do. I tried googling like converting to format long or something like that, i couldnt find anything. What can I do. Thank you.I have a double array with many values. The first value is 3.569990000000001, the next multiple values is 3.570000000000001, then comes 3.570010000000001 and it works like this. I can see only these long values which i click on that cell, otherwise every value is being displayed as 3.57. Now I applied unique, so the multiple 3.570000000000001 is removed and there is now only one 3.570000000000001 and again and so on, but still all values are seen as 3.57. So if compared the first two values to see if it equal it is showing that they are not equal even though me as the user sees both values as 3.57. Now here comes the problem. I need to use interp1 on these values, but here interp1 is not reading them as 3.569990000000001 and 3.570000000000001. Interp1 is reading both of them as 3.57 and is giving me an error saying values need to be unique. I dont know what to do. I tried googling like converting to format long or something like that, i couldnt find anything. What can I do. Thank you. I have a double array with many values. The first value is 3.569990000000001, the next multiple values is 3.570000000000001, then comes 3.570010000000001 and it works like this. I can see only these long values which i click on that cell, otherwise every value is being displayed as 3.57. Now I applied unique, so the multiple 3.570000000000001 is removed and there is now only one 3.570000000000001 and again and so on, but still all values are seen as 3.57. So if compared the first two values to see if it equal it is showing that they are not equal even though me as the user sees both values as 3.57. Now here comes the problem. I need to use interp1 on these values, but here interp1 is not reading them as 3.569990000000001 and 3.570000000000001. Interp1 is reading both of them as 3.57 and is giving me an error saying values need to be unique. I dont know what to do. I tried googling like converting to format long or something like that, i couldnt find anything. What can I do. Thank you. matlab MATLAB Answers — New Questions