MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   在Matlab中仅获取索引矩阵距离为N的邻居列表 (https://www.labfans.com/bbs/showthread.php?t=22399)

poster 2019-12-04 21:20

在Matlab中仅获取索引矩阵距离为N的邻居列表
 
我有一个像这样的矩阵:

35 1 6 26 19 24 3 32 7 21 23 25 31 9 2 22 27 20 8 28 33 17 10 15 30 5 34 12 14 16 4 36 29 13 18 11 我想要每个单元格的距离为3的邻居列表

例如,对于(1,1),距离为3的邻居列表为

[8, 28, 33, 17, 26, 21, 22, 17] [35] 1 6 |26| 19 24 3 32 7 |21| 23 25 31 9 2 |22| 27 20 ------------------- 8 28 33 |17| 10 15 ------------------- 30 5 34 12 14 16 4 36 29 13 18 11 距离为(3,2)的3的邻居列表是

[4, 36, 29, 13, 18, 11, 24, 25, 20, 15, 16] 35 1 6 26 19 |24| 3 32 7 21 23 |25| 31 9 [2] 22 27 |20| 8 28 33 17 10 |15| 30 5 34 12 14 |16| ------------------------ 4 36 29 13 18 |11| ------------------------

[url=https://stackoverflow.com/q/59176663]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 23:31

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.