preraulab_utilities¶
Meta-repository bundling the Prerau Lab’s general-purpose MATLAB utilities — binning, conversions, figure layout, plotting primitives, statistics, and workspace management.
Each category is its own standalone repository. This site is the aggregated reference pulled directly from docstrings in every sub-repo.
Standalone + bundled
Each category below is a separate git repository that can be cloned and used
on its own. This repo aggregates them as submodules, so a recursive clone
(git clone --recursive) or git submodule update --init --recursive
pulls everything.
Browse by category¶
1-D and N-D binning, sliding-window histograms.
Functions: create_bins, create_NDbins, hist_slide
Type, format, and representation conversions — numbers to strings, structs to name-value cells, tables ↔ CSV.
11 functions
Generic signal and index manipulation — consecutive runs, chunk detection, interval arithmetic.
6 functions
Figure layout, axes linking, interactive controls — the plumbing for good-looking multi-panel figures.
23 functions
Higher-level plot primitives — shaded bounds, Gantt charts, phase histograms, wireframes.
10 functions
NaN-aware statistical helpers.
Functions: nanzscore, nanpow2db
Workspace management — clear, close, package.
Functions: ccc, clear_all_except, packagecode
CSS-styled HTML-backed UI controls for uifigure apps — modern animated components without writing JavaScript.
Classes: CSSuiButton, CSSuiDropdown, CSSuiListBox, SmoothProgressBar, …
EDF / EDF+ reader with MEX acceleration, A-B rereferencing, annotation parsing, and de-identification.
Functions: read_EDF, header_gui
Quick examples¶
Consistent multi-panel figures¶
ax = figdesign(2, 3);
letter_label(ax, 'A', 'TopLeft');
linkcaxes(ax);
scrollzoompan(ax(1), 'x');
Bin and plot a point process¶
[counts, edges] = create_bins(spike_times, 0.050); % 50 ms bins
shadebounds((edges(1:end-1)+edges(2:end))/2, counts, counts+sqrt(counts), counts-sqrt(counts));
Round-trip a struct to a command-line string¶
opts = struct('Fs', 200, 'thresh', 3.5, 'verbose', true);
disp(struct2nvpstr(opts));
% -> 'Fs', 200, 'thresh', 3.5, 'verbose', true
Install¶
addpath(genpath('/path/to/preraulab_utilities'));
savepath; % optional
Design principles¶
R2020a-compatible. No
argumentsblocks, no name=value syntax, nodictionary.Small, composable. Each function does one thing; complex behavior comes from combinations.
NaN-aware where sensible. Anything named
nan*handles NaN gracefully.No hidden state. Interactive controls store per-axes
appdata, never globals.Canonical docstrings. Every
.mfile uses the lab’sUsage/Inputs/Outputs/See alsoformat — readable withhelp <function>.
Documentation map¶
Repository¶
Source code: https://github.com/preraulab/preraulab_utilities