# SPM/MATLAB
## Introduction

MATLAB (The MathWorks) is a high-level technical computing language and interactive environment for algorithm development, data visualization, data analysis, and numeric computation. Its syntax is close to that of matrix algebra, making the code an effective pseudo-code for the algorithms, and leading to fast development times.
The SPM software is a collection of MATLAB functions and thus requires the MATLAB software to be installed on your computer in order to run. SPM requires only core MATLAB to run (no special toolboxes are required - unless stated otherwise).
See the System Requirements page for a list of suitable platforms to run MATLAB and the Platform Roadmap for the correspondence between MATLAB versions and supported platforms.
Each SPM version was written for a particular MATLAB version and will not work with earlier versions. MATLAB versions released after SPM can have some peculiarities but SPM developers try to provide compatibility fixes in the updates (at least for recent SPM versions).

## MEX files

Whilst the majority of the code is implemented as standard MATLAB M-files, SPM also uses external MEX files, written in C, to perform some of the more computationally intensive operations. Pre-compiled binaries of these external C-MEX routines are provided for several platforms and correspond to files with extensions .mexwin32, .mexwin64, .mexglx, .mexa64, .mexmac, .mexmaci, .mexmaci64, .mexsol, .mexs64.
If the compiled MEX-files are provided for your platform, then SPM should work straight out of the box. If they are not provided or if they appear to be incompatible with your system, then you will need to create the MEX files using a suitable C compiler and the Makefile provided with the SPM distribution. To do so, follow the indications given in these pages for the corresponding platform:
* Windows 32 bit
* Windows 64 bit
* Linux 32 bit
* Linux 64 bit
* Mac PowerPC
* Mac Intel 32 bit
* Mac Intel 64 bit
* Solaris

## MATLAB Compatibility with SPM

| Version | Release | Date |
| 9.13 | R2022b | 2022 |
| 9.12 | R2022a | 2022 |
| 9.11 | R2021b | 2021 |
| 9.10 | R2021a | 2021 |
| 9.9 | R2020b | 2020 |
| 9.8 | R2020a | 2020 |
| 9.7 | R2019b | 2019 |
| 9.6 | R2019a | 2019 |
| 9.5 | R2018b | 2018 |
| 9.4 | R2018a | 2018 |
| 9.3 | R2017b | 2017 |
| 9.2 | R2017a | 2017 |
| 9.1 | R2016b | 2016 |
| 9.0 | R2016a | 2016 |
| 8.6 | R2015b | 2015 |
| 8.5 | R2015a | 2015 |
| 8.4 | R2014b | 2014 |
| 8.3 | R2014a | 2014 |
| 8.2 | R2013b | 2013 |
| 8.1 | R2013a | 2013 |
| 8.0 | R2012b | 2012 |
| 7.14 | R2012a | 2012 |
| 7.13 | R2011b | 2011 |
| 7.12 | R2011a | 2011 |
| 7.11 | R2010b | 2010 |
| 7.10 | R2010a | 2010 |
| 7.9 | R2009b | 2009 |
| 7.8 | R2009a | 2009 |
| 7.7 | R2008b | 2008 |
| 7.6 | R2008a | 2008 |
| 7.5 | R2007b | 2007 |
| 7.4 | R2007a | 2007 |
| 7.3 | R2006b | 2006 |
| 7.2 | R2006a | 2006 |
| 7.1 | R14SP3 | 2005 |
| 7.0.4 | R14SP2 | 2005 |
| 7.0.1 | R14SP1 | 2004 |
| 7 | R14 | 2004 |
| 6.5.2 | R13SP2 | 2003 |
| 6.5.1 | R13SP1 | 2003 |
| 6.5 | R13 | 2002 |
| 6.1 | R12.1 | 2001 |
| 6.0 | R12 | 2000 |
| 5.3.1 | R11.1 | 1999 |
| 5.3 | R11 | 1999 |
| 5.2.1 | R10.1 | 1998 |
Legend :
| Compatible | Compatible after fix | Incompatible | Unknown |
* ↑ The MathWorks Signal Processing Toolbox is required for M/EEG preprocessings (filtering, downsampling)
* ↑ See SPM8 project on GitHub.
* ↑ See SPM5 project on GitHub.
* ↑ See SPM2 project on GitHub.
* ↑ See SPM99 project on GitHub.
* 1 2 3 Some functionalities in the MEEG Review facility are disabled with these versions.

## Other numerical analysis software

GNU Octave is a free open source numerical analysis software similar to MATLAB. See SPM/Octave for more details about compatibility between SPM and Octave.
Julia is another modern programming language with excellent numerical computing abilities. Porting SPM to Julia would be a major investment but see this.