How robclewley/xpp-matlab works
Project type and purpose
• Type: A Matlab-based adapter/automation library (open-source tool)
• Purpose: Let users from Matlab
– programmatically modify XPP model files (.ode/.set)
– invoke the XPP simulation engine in “silent” batch mode
– load and analyze the output data back in Matlab
File structure
• Top-level .m scripts
– ChangeXPPodeFile.m, ChangeXPPsetFile.m – modify parameters in .ode/.set files
– RunXPP.m – invoke XPP executable via system/! call
– GetCrossings.m – post-process output.dat for threshold crossings
– meshplot_example.m – example driver script (runs sims & plots freq mesh)
• Example model and outputs
– HH_slowNa.ode – sample ODE file
– freq_mesh.fig – sample figure for meshplot
• Documentation & archives
– XPP-Matlab interface documentation.htm
– XPP-Matlab.zip
• README.md + LICENSE
Extract key architectural insights from README
• Communication is file-based: inject parameters into .ode/.set → run XPP → read ASCII output
• No in-process linking; relies on system calls and filesystem I/O
• Extension points: users can write new Matlab drivers around these interface calls
Main components & interactions
A. Matlab Environment
– Interface Library
• ChangeXPPodeFile
• ChangeXPPsetFile
• RunXPP
– Analysis Library
• GetCrossings
– User Scripts
• meshplot_example (and any other user-written drivers)
B. External XPP Simulation Engine (xppaut, xppwin, etc.)
C. Model Definition Files (HH_slowNa.ode, .set files)
D. Data Files
– input (modified .ode/.set)
– output (output.dat)
E. Visualization
– freq_mesh.fig (Matlab figure)
1. Interface Library → Model Files (modify parameters)
2. RunXPP → XPP Engine (system call)
3. XPP Engine → Data Files (writes output.dat)
4. Analysis Library → Data Files (reads output.dat)
5. User Scripts → Interface & Analysis Libraries (invokes functions)
6. Analysis Library → Visualization (generates .fig, plots)
Architectural patterns & design principles
• Adapter/Wrapper pattern—Matlab functions wrap external XPP calls
• File-based I/O decoupling—no direct API, everything flows through the filesystem
• Single responsibility—each .m has one clear job (modify files, run XPP, post-process)
• Extensibility—users can drop in new .ode models or write scripts that loop over parameters