ELdistanceofmatrixneighbors

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 4.7, Creation date: 2019-07-25, Last change: 2025-09-14

Calculates from a potential field consisting of doubles and nan the neighborhood weights

Description

This function is used to create weighted edge lists for graphs for search algorithms
1 2 3
4 5 6
7 8 9


See Also: GPLdistancetoCPL

Example Illustration

 missing image of ELdistanceofmatrixneighbors(M,n)

Syntax

[EL,iM,G]=ELdistanceofmatrixneighbors(M,[n])

Input Parameter

M: potential
n: default is 4 neighborhood

Output Parameter

EL: Edge List [Start End Distance]
iM: indices of Matrix
G: weighted graph

Examples


M=nan(4,4); M(2:3,2:3)=eye(2)
M=nan(5,5); M(2:4,2:4)= reshape(1:9,[],3)'; M
GPLdistancetoCPL(CPLsample(13),.1,'','','',true);
[GPL,M]=GPLdistancetoCPL(CPLsample(13),.5,'','','',true);
[EL,G]=ELdistanceofmatrixneighbors(M);
ai=GPLnearestpoint(GPL), bi=GPLnearestpoint(GPL), pli=shortestpath(G,ai,bi); PLplot(GPL(pli,:))




Copyright 2019-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Last html export of this page out of FM database by TL: 2025-09-21