why setdiff function ignores to delete the element in the first column of an array

1 回表示 (過去 30 日間)
>> w =[0.54883746334269044248968027421965, 1.5707963267948966192313216916398, 0.59916277322729276097921590697775;1.5707963267948966192313216916398, 0.7011471887975026432568455778359, 1.5707963267948966192313216916398;-0.54883746334269044248968027421965, -0.7011471887975026432568455778359, -0.59916277322729276097921590697775]
e=setdiff(w,1.5708,'stable')
w =
0.5488 1.5708 0.5992
1.5708 0.7011 1.5708
-0.5488 -0.7011 -0.5992
e =
0.5488
1.5708 (this entry should not be there, but it persists)
-0.5488
0.7011
-0.7011
0.5992
-0.5992
please let me know what change i need to make in setdiff so that the second entry in 'e' gets deleted
  2 件のコメント
Stephen23
Stephen23 2020 年 4 月 3 日
編集済み: Stephen23 2020 年 4 月 3 日
MUTHUKUMARASAMY V
MUTHUKUMARASAMY V 2020 年 4 月 4 日
Thanks stephen. I got it right

サインインしてコメントする。

採用された回答

Fangjun Jiang
Fangjun Jiang 2020 年 4 月 3 日
You've show its value is 1.5707963267948966192313216916398.
It is the floating point data precision issue.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by