Conversion examples
Real MATLAB snippets converted to Python by the same engine that powers the live converter. Each example shows the MATLAB source, the converter's Python output, and notes on what changed and why.
Butterworth Lowpass Filter
Design a 4th-order Butterworth filter and apply it with zero-phase filtfilt — the canonical Signal Processing Toolbox use case.
FFT Frequency Spectrum
Compute a single-sided amplitude spectrum using FFT — the tutorial everyone writes when they start with signal processing.
Peak Detection
Find local maxima above a threshold with findpeaks — heart-rate detection, spike counting, spectral peaks.
Linear Regression
Fit a linear model and plot the residuals — the simplest fitting example, and what most people actually need.
Image Threshold and Region Labeling
Read an image, threshold it, label connected components — the 'hello world' of Image Processing Toolbox.
ODE45 — Solve an ODE
Solve a damped harmonic oscillator with ode45 — the workhorse of engineering coursework.
Monte Carlo Estimation of π
The classic Monte Carlo — sample points in a unit square and count how many fall in the inscribed circle.
K-Means Clustering
Cluster 2D points with MATLAB's kmeans — the simplest entry into the Statistics Toolbox.
Linear System Ax = b
MATLAB's backslash operator `A\b` — solve a linear system the way every engineer learned.
Sort with Indices
[sorted_vals, idx] = sort(X) — one of those MATLAB idioms that breaks when ported naively.
Free for 50 lines. No account required.