Conformal

Static shape analysis for MATLAB. Finds matrix dimension mismatches before your code runs. No MATLAB license needed.

your code
function result = process(data, weights)
    scaled = data .* weights;
    result = scaled' * scaled;
end

A = rand(10, 3);
w = rand(4, 1);  % wrong size
R = process(A, w);
conformal output
W_ELEMENTWISE_MISMATCH line 2:
  data .* weights:
  matrix[10 x 3] vs matrix[4 x 1]
  (in process, called from line 8)

The shapes follow into the function.
data is 10x3, weights is 4x1.
Line 2 is where it breaks.
process.m
Conformal showing inline diagnostics in VS Code

Diagnostics appear as you type. Hover any variable to see its shape.

15,085 real-world files tested
0 crashes
552 test cases
<250ms per file
650+ builtins recognized

What it covers

Arithmetic, concatenation, indexing, struct fields, cell arrays, classdef objects, cross-file function calls, nested functions, closures, nargin/nargout, varargin. Dimensions can be symbolic: zeros(n+1, 2*m) tracks as matrix[(n+1) x (2*m)], and those expressions carry through the whole program. Loop index bounds are tracked relationally, so for i=1:n-1; A(i+1) won't false-positive.

For CI pipelines

--format sarif produces SARIF 2.1.0 with SHA-256 file hashes for traceability. --batch dir/ sweeps a directory in one process. .conformal.json locks per-repo settings so the whole team runs the same checks. --coder flags constructs that MATLAB Coder can't compile. Output is deterministic.

Using Conformal from the MATLAB IDE

Conformal ships as a standalone CLI binary. To use it from MATLAB's command window:

1
Download the CLI
Get the conformal binary for your OS from GitHub Releases and put it on your system PATH. It's a single native executable with no dependencies.
2
Add conformal_check.m to your MATLAB path
Download conformal_check.m and save it anywhere on your MATLAB path. This is a small wrapper that calls the CLI binary and prints results in the command window.
3
Analyze
>> conformal_check to analyze whatever file you have open in the editor.
>> conformal_check('ekf_update.m') to analyze a specific file.

For a team: put both files on a shared drive and add it in everyone's startup.m.

Where it's been tested

15,085 .m files from 34 public projects, including chebfun (3,435 files), PlatEMO (2,416), MATPOWER (979), NASA's MUSCAT spacecraft toolkit, the KU CReSIS polar radar toolbox, LADAC aircraft dynamics, eeglab, and ecg-kit. Zero crashes across the full corpus.

aerospace optimization numerical methods biomedical power systems geophysics computer vision signal processing CFD controls radar robotics rocketry

Conformal Migrate

The repo also includes a MATLAB-to-Python transpiler. It uses the shape analysis to pick * vs np.dot, handles 204 builtins, and converts 1-based indexing to 0-based with constant folding. Work in progress.