This repository collects small, self-contained MATLAB functions, scripts, and mini‑projects that I’ve found useful in research and day‑to‑day coding. Each tool lives in its own subfolder with a clean, ready‑to‑use version.
Each tool is in its own subfolder and includes its main function/script plus a minimal test/demo.
Discretising the probability mass of a bivariate normal distribution over a rectangular grid.
Highlights
- Single vectorised CDF table + 2D inclusion–exclusion for speed and stability.
- Per-dimension control of grid size and ±σ range (
nPoints=[n1;n2],nStd=[s1;s2]).
Function to draw a random sample from an arbitrary N-dimensional discrete distribution.
Highlights
- Arbitrary number of dimensions handled via inputting grid using cells.
- Sampling done via call to linear index using
idx = discretize(u, edges).
MIT License — free to use, modify, and share. Please retain license notices in derived work.