GPLofmatrix

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - VM/Voxels
Introduced first in SolidGeometry 4.8, Creation date: 2019-11-22, Last change: 2025-09-14

creates for a 2D matrix a grid point list with coordinates

Description

will be extended in future for 3D grids
add a colorbar if desired
use colormap(jet) to see extrem values better
NaN is plotted as square

See Also: ELdistanceofmatrixneighbors , VMofVL , matrixplot , matrixneighbors , matrixvalues , matrixdistancefield

Example Illustration

 missing image of GPLofmatrix(M,flpud,ax)

Syntax

[GPL,X,Y]=GPLofmatrix(M,[flpud,ax])

Input Parameter

M: Matrix (n x m)
flpud: flipud for rows values; default is true
ax: [xmin xmax ymin ymax]; default is [1 size(M,2) 1 size(M,1)]

Output Parameter

GPL: GPL coordiate list; sorted 1:numel(M)
X: X coordiate of GPL; sorted 1:numel(M)
Y: Y coordiate of GPL; sorted 1:numel(M)

Examples


m=16; M=circshift(reshape(1:m*m,m,[]),[floor(randminv(m)),floor(randminv(m))])
n=m; for i=1:n; M(floor(randminv(m)),floor(randminv(m)))=0; end; M
GPLofmatrix(M(1:10,1:8),false,[5 25 4 67]);
GPLofmatrix(M(1:10,1:8),true,[5 25 4 67]);
GPLofmatrix(M,false);
GPLofmatrix(M,true); M
n=3; for i=1:n; M(floor(randminv(m)),floor(randminv(m)))=nan; end; M
GPLofmatrix(M,true); M




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