VLmeshgrid

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

simple fnct for a better understand of meshgrid

Description

[XL,YL,ZL]=meshgrid(xx,yy,zz);
VL=[reshape(XL,[],1) reshape(YL,[],1) reshape(ZL,[],1)];


See Also: , PLmeshgrid

Example Illustration

 missing image of VLmeshgrid(xx,yy,zz)

Syntax

VL=VLmeshgrid(xx,yy,[zz])

Input Parameter

xx: list of x values
yy: list of y values
zz: list of y values;

Output Parameter

VL: Point list of all mesh coordinates

Examples


VLmeshgrid(1:3,1:2,10)
VLmeshgrid([0 15 25 35 45 55 65],0:8:8*22,[10 20])




Copyright 2017-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

Algorithm (Workflow)

This function, VLmeshgrid, is designed to generate a list of 3D mesh coordinates based on input vectors for x, y, and optionally z dimensions. It is part of the SG-Library and was introduced in SolidGeometry 4.0.

Input Parameters

Output

Algorithm Steps

  1. Initialize zz to 0. If a third argument is provided and is not empty, set zz to this value.
  2. Use the meshgrid function to create 3D grids XL, YL, and ZL from xx, yy, and zz.
  3. Reshape these grids into column vectors and concatenate them to form the output VL.
  4. If only two input arguments are provided, adjust VL to include only the x and y coordinates.
  5. If no output is requested, plot the points using SGfigure and CVLplot. Adjust the view based on the number of input arguments.

Example Usage

Algorithm explaination created using ChatGPT on 2025-08-19 00:15. (Please note: No guarantee for the correctness of this explanation)

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