randv - random vectors, with constraint axis

Generate random vectors on a unit sphere/circle/etc, and random vectors from a given axis based on cone-like constraints.

Al momento, stai seguendo questo contributo

A bit of code that i've ended up needing to have multiple times for different reasons and got tired of rebuilding it each time. Might be useful for anyone looking for similar random vectors.
Simple use case: generating a number of random vectors, uniformly distributed on the surface of the unit shape of at least dimension 2. Trivial use of randn and vecnorm.
Complex use cases: generating random vectors based on a given axis and constrained by some set of angles. Can make rings, cones, negative cones within spheres, etc. Only works for 3-dim vectors. Useful for getting a random 'search area' cone, random walks, of getting random radial deflections.

Cita come

Carson Purnell (2026). randv - random vectors, with constraint axis (https://it.mathworks.com/matlabcentral/fileexchange/135301-randv-random-vectors-with-constraint-axis), MATLAB Central File Exchange. Recuperato .

Informazioni generali

Compatibilità della release di MATLAB

  • Compatibile con qualsiasi release

Compatibilità della piattaforma

  • Windows
  • macOS
  • Linux
Versione Pubblicato Note della release Action
1.0.0