randnorm

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 5.0, Creation date: 2021-01-15, Last change: 2025-09-15

same as normrnd but a different argument more than rand



See Also: , randdice , meanGauss

Example Illustration

 missing image of randnorm(r,c,m,s)

Syntax

y=randnorm([r,c,m,s])

Input Parameter

r: rows
c: cols; default is r
m: mean
s: standard deviation

Output Parameter

y: random numbers

Examples


randnorm(6,1)
randnorm(6,1,100,5)
randnorm(6,1,100,5); meanGauss(ans)




Copyright 2021-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, randnorm, generates random numbers with a normal distribution. It is part of the SolidGeometry library and was introduced in version 5.0. The function is designed to be an auxiliary procedure for generating normally distributed random numbers.

Input Parameters

Output

Function Workflow

The function begins by retrieving the input parameters using the helper function getfuncparams. This function is called four times to obtain the values for r, c, m, and s. The default values are set as follows:

After obtaining the parameters, the function uses the normrnd function to generate a matrix of random numbers. The normrnd function takes the mean m, standard deviation s, and the size of the output matrix [r, c] as inputs. The result is stored in the variable y, which is then returned as the output of the function.

Example Usage

Algorithm explaination created using ChatGPT on 2025-08-18 22:48. (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