pancho_hideboo
Advanced Member level 5
- Joined
- Oct 21, 2006
- Messages
- 2,847
- Helped
- 767
- Reputation
- 1,536
- Reaction score
- 733
- Trophy points
- 1,393
- Location
- Real Homeless
- Activity points
- 17,490
We can get the completely same values in Array but with no repetitions
by using "unique()" in MATLAB.
Here I would like to relax an euqality condition.
For example, I want to treat 1.0 and 1.001 as same value.
However we can not set tolerance in "unique()".
How can I degenarate Array with finite tolerance in MATLAB ?
by using "unique()" in MATLAB.
Code:
>> A=[1, 1, 2, 3, 4]
A =
1 1 2 3 4
>> unique(A)
ans =
1 2 3 4
Here I would like to relax an euqality condition.
For example, I want to treat 1.0 and 1.001 as same value.
However we can not set tolerance in "unique()".
How can I degenarate Array with finite tolerance in MATLAB ?
Code:
>> A=[1.0, 1.001, 2, 3, 4]
A =
1.0000 1.0010 2.0000 3.0000 4.0000
>> unique(A)
ans =
1.0000 1.0010 2.0000 3.0000 4.0000
>>