フィルターのクリア

Problem with Unique on table

3 ビュー (過去 30 日間)
Krystian
Krystian 2021 年 3 月 7 日
編集済み: Krystian 2021 年 3 月 8 日
When a table t is:
t =
11×4 table
Apex Left Right Type
_________ _______________ _______________ ____
0+3.0777i -1+0i 1+0i A
0+3.0777i -2.618+1.1756i -1+0i Ap
0+3.0777i -3.2361+3.0777i -2.618+1.1756i A
0+3.0777i -2.618+4.9798i -3.2361+3.0777i Ap
0+3.0777i -1+6.1554i -2.618+4.9798i A
0+3.0777i 1+6.1554i -1+6.1554i Ap
0+3.0777i 2.618+4.9798i 1+6.1554i A
0+3.0777i 3.2361+3.0777i 2.618+4.9798i Ap
0+3.0777i 2.618+1.1756i 3.2361+3.0777i A
0+3.0777i 1+0i 2.618+1.1756i Ap
0+3.0777i -1+0i 1+0i A
Why 'unique' used as:
>> tu=unique(t,'rows')
tu =
11×4 table
Apex Left Right Type
_________ _______________ _______________ ____
0+3.0777i -1+0i 1+0i A
0+3.0777i 1+0i 2.618+1.1756i Ap
0+3.0777i -1+0i 1+0i A
0+3.0777i -2.618+1.1756i -1+0i Ap
0+3.0777i 2.618+1.1756i 3.2361+3.0777i A
0+3.0777i 3.2361+3.0777i 2.618+4.9798i Ap
0+3.0777i -3.2361+3.0777i -2.618+1.1756i A
0+3.0777i 2.618+4.9798i 1+6.1554i A
0+3.0777i -2.618+4.9798i -3.2361+3.0777i Ap
0+3.0777i 1+6.1554i -1+6.1554i Ap
0+3.0777i -1+6.1554i -2.618+4.9798i A
produces 11 rows with tu(1,:) identical to tu(3,:) ?

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 3 月 7 日
Use format long g and then look at the entries again. And check out
tu.Apex(1)-tu.Apex(3)
and you will probably see a small difference.
  1 件のコメント
Krystian
Krystian 2021 年 3 月 8 日
編集済み: Krystian 2021 年 3 月 8 日
Not quite, Apexes are all the same and produce isequal=1, but i figured meanwhile that t.Left and t.Right are respectivelly 1 and 1.000 and -1 and -1.000. Now I need something like uniquetol which would work on tables. Because:
Error using uniquetol
Input A must be a real full matrix of type single or double.
Error in MySunShining (line 22)
tut=uniquetol(t)
Thanks so far.

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

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by