matrixrand

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

returns random values for coordinates of a matrix

Description

.. more or less for testing path planning ..
currently just 2D

See Also: GPLofmatrix , randminv

Example Illustration

 missing image of matrixrand(M,n)

Syntax

PLrc=matrixrand(M,[n])

Input Parameter

M: Matrix
n: number of random coordianates

Output Parameter

PLrc: coordinate list for matrix M

Examples


M=zeros(5,10), matrixrand(M,6)




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

Algorithm (Workflow)

This function, matrixrand, generates random coordinates within the dimensions of a given matrix. It is primarily used for testing path planning in a 2D space.

Input Parameters

Output

Algorithm Steps

  1. Check if the input M is a matrix with more than one row. If so, issue a warning that the function is faster if only the size is provided.
  2. Determine the size of the matrix M and store it in MS.
  3. Retrieve the number of random coordinates n using the helper function getfuncparams. If n is not provided, default to 1.
  4. Initialize PLrc as a zero matrix with n rows and 2 columns.
  5. For each coordinate to be generated (from 1 to n):
Algorithm explaination created using ChatGPT on 2025-08-18 23:41. (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