簡體   English   中英

如何在 Matlab 中計算 3D 繪圖的頻率?

[英]How can I count frequency of 3D plot in Matlab?

我在每個向量中有 3D 點 (x,y,z) 的列表。

matrix[4535x3] = [3,4,2; 3,5,3; 4,5,2; 4,7,6; ...]

我想計算每個 3D 點的頻率。 例如,

[frequency_count] = function([4535x3 3d(x,y,z) points])

[4;        [3,5,4;
 4;         5,4,4;
 6;    <=   2,5,4;
 .          .
 .          .
 . ]        .     ]

matlab中有沒有可以計算3d點的函數? 如果不是,我該怎么做?

我還沒有測試過這個,但我相信你可以使用unique和這樣的三個輸出:

[unique_points, ia, ic] = unique(matrix, 'rows');

然后,像這樣在ic上使用accumarray

frequency_count = accumarray(ic,1);
point_count = [unique_points, frequency_count];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM