diff --git a/README.md b/README.md index 09d96ecf3..28e949ac3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ ## PsPM +[![GitHub release (latest by date)](https://img.shields.io/github/v/release/bachlab/PsPM)](https://github.com/bachlab/PsPM/releases) +[![GitHub Release Date](https://img.shields.io/github/release-date/bachlab/PsPM)](https://github.com/bachlab/PsPM/releases) +[![Build Status](https://sphinx.bli.uzh.ch/jenkins/buildStatus/icon?job=PsPM)](https://github.com/bachlab/PsPM) +[![Website](https://img.shields.io/website?down_color=lightgrey&down_message=offline&up_color=green&up_message=online&url=https%3A%2F%2Fbachlab.github.io%2FPsPM)](https://bachlab.github.io/PsPM) +[![License](https://img.shields.io/github/license/bachlab/PsPM)](https://www.gnu.org/licenses/gpl-3.0) + **PsPM** stands for PsychoPhysiological Modelling. It is a powerful matlab toolbox for model-based analysis of psychophysiological signals, for example SCR, ECG, respiration, pupil size, or startle eye-blink EMG. Currently, **PsPM** implements models for all of these modalities, and we are working towards further models, for example, for skin potential and ocular scan path length. A **PsPM** allows inferring a psychological variable from observable physiological data. For example, associative memory can be inferred from observed skin conductance responses (SCR). This allows for quantitative description of hidden processes, increases the temporal resolution of analysis, and suppresses noise. diff --git a/doc/icons/button_add_epoch.PNG b/doc/Figures/icons/button_add_epoch.PNG similarity index 100% rename from doc/icons/button_add_epoch.PNG rename to doc/Figures/icons/button_add_epoch.PNG diff --git a/doc/icons/button_navigate_epochs.PNG b/doc/Figures/icons/button_navigate_epochs.PNG similarity index 100% rename from doc/icons/button_navigate_epochs.PNG rename to doc/Figures/icons/button_navigate_epochs.PNG diff --git a/doc/icons/button_pan.PNG b/doc/Figures/icons/button_pan.PNG similarity index 100% rename from doc/icons/button_pan.PNG rename to doc/Figures/icons/button_pan.PNG diff --git a/doc/icons/button_remove_epoch.PNG b/doc/Figures/icons/button_remove_epoch.PNG similarity index 100% rename from doc/icons/button_remove_epoch.PNG rename to doc/Figures/icons/button_remove_epoch.PNG diff --git a/doc/icons/button_zoom.PNG b/doc/Figures/icons/button_zoom.PNG similarity index 100% rename from doc/icons/button_zoom.PNG rename to doc/Figures/icons/button_zoom.PNG diff --git a/doc/PsPM_Developers_Guide.lyx b/doc/PsPM_Developers_Guide.lyx index ff6c21df9..140ed842e 100644 --- a/doc/PsPM_Developers_Guide.lyx +++ b/doc/PsPM_Developers_Guide.lyx @@ -98,7 +98,7 @@ Developer's Guide \begin_layout Standard \align center -Version 4.2.1 +Version 4.3.0 \end_layout \begin_layout Standard @@ -7996,7 +7996,7 @@ Tests: \begin_inset Tabular - + @@ -8074,7 +8074,27 @@ pspm_extract_segments('manual',fn,0) \begin_inset Text \begin_layout Plain Layout -ID:invalid_inpu +ID:invalid_input +\end_layout + +\end_inset + + + + +\begin_inset Text + +\begin_layout Plain Layout +pspm_extract_segments('manual',struct('a',10),0,timing) +\end_layout + +\end_inset + + +\begin_inset Text + +\begin_layout Plain Layout +ID:invalid_input \end_layout \end_inset @@ -8085,7 +8105,7 @@ ID:invalid_inpu \begin_inset Text \begin_layout Plain Layout -pspm_extract_segments('manual',[0.1,2],0,timing) +pspm_extract_segments('manual',[1,3],logical(32),timing) \end_layout \end_inset diff --git a/doc/PsPM_Manual.lyx b/doc/PsPM_Manual.lyx index 65cc8ff5b..6e62f0044 100644 --- a/doc/PsPM_Manual.lyx +++ b/doc/PsPM_Manual.lyx @@ -103,7 +103,7 @@ PsPM: Psychophysiological Modelling \begin_layout Standard \align center -Version 4.2.1 +Version 4.3.0 \end_layout \begin_layout Standard @@ -9765,6 +9765,17 @@ ts designs it needs to be set to false. \end_layout +\begin_layout Subsubsection* +Centering +\end_layout + +\begin_layout Standard +Specify if you want to mean centering the convoluted X data. + By default this centering is applied to every model but for some specific + cases such as some scanpath length analysis it has to be set to 0 (i.e. + False). +\end_layout + \begin_layout Subsubsection* Filter Settings \end_layout @@ -12357,13 +12368,13 @@ Data navigation \begin_layout Standard Data navigation can be done by zooming ( \begin_inset Graphics - filename icons/button_zoom.PNG + filename Figures/icons/button_zoom.PNG \end_inset ) and panning ( \begin_inset Graphics - filename icons/button_pan.PNG + filename Figures/icons/button_pan.PNG \end_inset @@ -12390,7 +12401,7 @@ Add epochs \begin_layout Standard New epochs can be added by clicking the 'add epoch' button ( \begin_inset Graphics - filename icons/button_add_epoch.PNG + filename Figures/icons/button_add_epoch.PNG \end_inset @@ -12409,7 +12420,7 @@ Remove epochs \begin_layout Standard Existing epochs can be removed by clicking the 'remove epoch' button ( \begin_inset Graphics - filename icons/button_remove_epoch.PNG + filename Figures/icons/button_remove_epoch.PNG \end_inset @@ -12428,7 +12439,7 @@ Epoch navigation In order to navigate between epochs it is either possible to use the epoch list on the right side or the two epoch navigation buttons ( \begin_inset Graphics - filename icons/button_navigate_epochs.PNG + filename Figures/icons/button_navigate_epochs.PNG \end_inset @@ -13139,6 +13150,75 @@ Onsets: Specify a vector of onsets. Duration: Specify the length of the condition. \end_layout +\end_deeper +\end_deeper +\end_deeper +\begin_layout Itemize + +\series bold +Raw: +\series default + Specify all the settings manually (i.e. + choose manual mode) and provide raw data +\end_layout + +\begin_deeper +\begin_layout Itemize + +\shape italic +Data +\shape default +: Numeric raw data or a cell array of numeric raw data. +\end_layout + +\begin_layout Itemize + +\shape italic +Sampling rate +\shape default +: One sampling rate or an array of sampling rates of the corresponding +\shape italic +Data +\shape default +. +\end_layout + +\begin_layout Itemize + +\shape italic +Conditions +\shape default +: +\end_layout + +\begin_deeper +\begin_layout Itemize +Condition files: Should be in the format of the conditions defined in a + GLM model. + Required fields are names, onsets, duration. +\end_layout + +\begin_layout Itemize +Enter conditions manually: Specify the conditions that you want to include + in your design matrix. +\end_layout + +\begin_deeper +\begin_layout Itemize +Name: Specify the name of the condition. +\end_layout + +\begin_layout Itemize +Onsets: Specify a vector of onsets. + The length of the vector corresponds to the number of events included in + this condition. + Onsets have to be indicated in the specified time unit (‘seconds’, ‘samples’). +\end_layout + +\begin_layout Itemize +Duration: Specify the length of the condition. +\end_layout + \end_deeper \end_deeper \end_deeper @@ -13586,8 +13666,8 @@ Here, we analyze SCR data using a general linear model (GLM). downloaded from \begin_inset CommandInset href LatexCommand href -name "https://sourceforge.net/projects/pspm/files/Tutorial_dataset_GLM.zip/download" -target "https://sourceforge.net/projects/pspm/files/Tutorial_dataset_GLM.zip/download" +name "https://bachlab.github.io/PsPM/software/" +target "https://bachlab.github.io/PsPM/software/" literal "false" \end_inset @@ -13606,6 +13686,8 @@ literal "true" that included two short breaks. SCR data were recorded using a 0.5 V coupler, optical (wave to pulse) transducer , and CED Spike, with a minimum sampling rate of 100 Hz. + Be aware that this example uses functions from the MATLAB Signal Processing + Toolbox, make sure to have it installed before starting the tutorial. \end_layout \begin_layout Subsection @@ -14662,8 +14744,8 @@ The example data set comprises SCR data from 20 participants, with 40 trials each, which can be downloaded from \begin_inset CommandInset href LatexCommand href -name "pspm.sourceforge.net" -target "http://pspm.sourceforge.net" +name "https://bachlab.github.io/PsPM/software/" +target "https://bachlab.github.io/PsPM/software/" literal "false" \end_inset @@ -18881,6 +18963,134 @@ pspm_filtfilt which crashed when the filter parameters were of dimension one \end_layout +\begin_layout Section +PsPM Version 4.3.0 +\end_layout + +\begin_layout Subsection* +New Features +\end_layout + +\begin_layout Itemize +In +\family typewriter +pspm_get_events +\family default +, +\family typewriter +import.flank +\family default + can be now set to +\family typewriter +'all' +\family default + what would import all markers and data related to them. +\end_layout + +\begin_layout Itemize + +\family typewriter +pspm_display +\family default +allows now to display pupil size units and the gaze x & y coordinate units + on the y-axis. +\end_layout + +\begin_layout Itemize + +\family typewriter +pspm_extract_segments +\family default +can be used now with raw data and thus be called easily within another function. +\end_layout + +\begin_layout Subsection* +Changes +\end_layout + +\begin_layout Itemize + +\family typewriter +pspm_version +\family default + has a new url and thus do not send any warning about version checks anymore. +\end_layout + +\begin_layout Itemize + +\family typewriter +import_eyelink +\family default + do not import markers which are outside the session end time ( +\family typewriter +END +\family default + marker). +\end_layout + +\begin_layout Itemize + +\family typewriter +import_eyelink +\family default + sends a warning whenever two markers have the same timestamp. +\end_layout + +\begin_layout Itemize +In +\family typewriter +pspm_get_eyelink +\family default +, +\family typewriter +import.flank +\family default + set to +\family typewriter +'all' +\family default +. +\end_layout + +\begin_layout Itemize +The test of +\family typewriter +pspm_extract_segments +\family default + was adapted to the new feature. +\end_layout + +\begin_layout Itemize +External functions and libraries were regrouped in one folder called +\family typewriter +ext. +\end_layout + +\begin_layout Subsection* +Bugfixes +\end_layout + +\begin_layout Itemize +Fix a bux in +\family typewriter +pspm_bf_lcrf_gm +\family default + and +\family typewriter +pspm_bf_ldrf_gm +\family default + where the offset was wrongly implemented. +\end_layout + +\begin_layout Itemize +Fix a bug in +\family typewriter +pspm_compute_visual_angle +\family default + where there was an error in the conversion factor of pixels wrt. + to mm. +\end_layout + \begin_layout Part Acknowledgements \end_layout diff --git a/doc/PsPM_release_checklist.md b/doc/PsPM_release_checklist.md index 5520506ec..6455615a8 100644 --- a/doc/PsPM_release_checklist.md +++ b/doc/PsPM_release_checklist.md @@ -5,23 +5,24 @@ any revisions (commits) that implement/fix something new in the release branch, don't merge these branches back to trunk. Therefore, it is sensible to create the release branch after making absolutely sure that no new stuff will be implemented. -- [ ] Update version number & date in - - [ ] `pspm_msg` - - [ ] `pspm_quit` - - [ ] `pspm.fig`: Load `pspm.fig` into MATLAB, update `fig.Children(9).String` and save back to `pspm.fig` - - [ ] Manual and Developers Guide: front pages -- [ ] Make sure both manuals are updated -- [ ] Add release notes section of the new version to manual (at the end) -- [ ] Get the manual reviewed -- [ ] Create manual and dev guide PDFs using `lyx` -- [ ] Check if underscores and dashes are visible in newly added manual sections -- [ ] Create svn branch -- [ ] Delete `.asv` files if there are any (?) -- [ ] Create zip of the new branch -- [ ] Make sure zip doesn't contain any svn related files. As a sanity check, the zip file +- [x] Update version number & date in + - [x] `pspm_msg` + - [x] `pspm_quit` + - [x] `pspm.fig`: Load `pspm.fig` into MATLAB, update `fig.Children(9).String` and save back to `pspm.fig` + - [x] Manual and Developers Guide: front pages +- [x] Make sure both manuals are updated +- [x] Add release notes section of the new version to manual (at the end) +- [x] Get the manual reviewed +- [x] Create manual and dev guide PDFs using `lyx` +- [x] Check if underscores and dashes are visible in newly added manual sections +- [x] Create git branch +- [x] Delete `.asv` files if there are any (?) +- [x] Create zip of the new branch +- [x] Make sure zip doesn't contain any svn related files. As a sanity check, the zip file should be roughly the same size as the previous version zip files (maybe slightly larger but not much) -- [ ] Update screenshot in Sourceforge -- [ ] Upload zip to sourceforge - - [ ] Make sure the newly added zip file is the default download (click on (i) icon) -- [ ] Add release message to pspm.sourceforge.net -- [ ] Add release message to lab webpage +- [ ] Create a release on GitHub +- [ ] Upload zip to GitHub + - [ ] Make sure the newly added zip file is the default download +- [ ] Add release message to GitHub +- [ ] Change release number on lab webpage (gh-pages branch) +- [ ] Add release message to lab webpage (gh-pages branch) diff --git a/src/References/Bach & Friston 2012 NeuroImage PredictionError SCR.pdf b/doc/References/Bach & Friston 2012 NeuroImage PredictionError SCR.pdf similarity index 100% rename from src/References/Bach & Friston 2012 NeuroImage PredictionError SCR.pdf rename to doc/References/Bach & Friston 2012 NeuroImage PredictionError SCR.pdf diff --git a/src/References/Bach & Friston 2013 Psychophysiology SCR Model Review.pdf b/doc/References/Bach & Friston 2013 Psychophysiology SCR Model Review.pdf similarity index 100% rename from src/References/Bach & Friston 2013 Psychophysiology SCR Model Review.pdf rename to doc/References/Bach & Friston 2013 Psychophysiology SCR Model Review.pdf diff --git a/src/References/Bach 2014 BiolPsychology Comparison SCRalzye-Ledalab.pdf b/doc/References/Bach 2014 BiolPsychology Comparison SCRalzye-Ledalab.pdf similarity index 100% rename from src/References/Bach 2014 BiolPsychology Comparison SCRalzye-Ledalab.pdf rename to doc/References/Bach 2014 BiolPsychology Comparison SCRalzye-Ledalab.pdf diff --git a/src/References/Bach et al. 2010 Biological Psychology_DCM-aSCR.pdf b/doc/References/Bach et al. 2010 Biological Psychology_DCM-aSCR.pdf similarity index 100% rename from src/References/Bach et al. 2010 Biological Psychology_DCM-aSCR.pdf rename to doc/References/Bach et al. 2010 Biological Psychology_DCM-aSCR.pdf diff --git a/src/References/Bach et al. 2011 Psychophysiology DCM_SF.pdf b/doc/References/Bach et al. 2011 Psychophysiology DCM_SF.pdf similarity index 100% rename from src/References/Bach et al. 2011 Psychophysiology DCM_SF.pdf rename to doc/References/Bach et al. 2011 Psychophysiology DCM_SF.pdf diff --git a/src/References/BachFlandinFristonDolan_2009_SCR_GLM.pdf b/doc/References/BachFlandinFristonDolan_2009_SCR_GLM.pdf similarity index 100% rename from src/References/BachFlandinFristonDolan_2009_SCR_GLM.pdf rename to doc/References/BachFlandinFristonDolan_2009_SCR_GLM.pdf diff --git a/src/References/BachFlandinFristonDolan_2010_IJP_SCR_LTI.pdf b/doc/References/BachFlandinFristonDolan_2010_IJP_SCR_LTI.pdf similarity index 100% rename from src/References/BachFlandinFristonDolan_2010_IJP_SCR_LTI.pdf rename to doc/References/BachFlandinFristonDolan_2010_IJP_SCR_LTI.pdf diff --git a/src/References/BachFristonDolan_2010_IJP_SF_AUC.pdf b/doc/References/BachFristonDolan_2010_IJP_SF_AUC.pdf similarity index 100% rename from src/References/BachFristonDolan_2010_IJP_SF_AUC.pdf rename to doc/References/BachFristonDolan_2010_IJP_SF_AUC.pdf diff --git a/doc/release_notes.tex b/doc/release_notes.tex index a9934cc85..b99d9ba8b 100644 --- a/doc/release_notes.tex +++ b/doc/release_notes.tex @@ -65,7 +65,7 @@ framexleftmargin=1pt, frame=l} \renewcommand{\lstlistingname}{Listing} -\title{PsPM 4.2.1 Release notes} +\title{PsPM 4.3.0 Release notes} \begin{document} \maketitle @@ -571,6 +571,41 @@ \subsection*{Bugfixes} parameters were of dimension one \end{itemize} +\section{PsPM Version 4.3.0} + +\subsection*{New Features} +\begin{itemize} +\item In \texttt{pspm\_get\_events}, \texttt{import.flank} can be now set +to \texttt{'all'} what would import all markers and data related to +them. +\item \texttt{pspm\_display }allows now to display pupil size units and +the gaze x \& y coordinate units on the y-axis. +\item \texttt{pspm\_extract\_segments }can be used now with raw data and +thus be called easily within another function. +\end{itemize} + +\subsection*{Changes} +\begin{itemize} +\item \texttt{pspm\_version} has a new url and thus do not send any warning +about version checks anymore. +\item \texttt{import\_eyelink} do not import markers which are outside the +session end time (\texttt{END} marker). +\item \texttt{import\_eyelink} sends a warning whenever two markers have +the same timestamp. +\item In \texttt{pspm\_get\_eyelink}, \texttt{import.flank} set to \texttt{'all'}. +\item The test of \texttt{pspm\_extract\_segments} was adapted to the new +feature. +\item External functions and libraries were regrouped in one folder called +\texttt{ext.} +\end{itemize} + +\subsection*{Bugfixes} +\begin{itemize} +\item Fix a bux in \texttt{pspm\_bf\_lcrf\_gm} and \texttt{pspm\_bf\_ldrf\_gm} +where the offset was wrongly implemented. +\item Fix a bug in \texttt{pspm\_compute\_visual\_angle} where there was +an error in the conversion factor of pixels wrt. to mm. +\end{itemize} \section{References} diff --git a/src/Data/CRF_Database.mat b/src/Data/CRF_Database.mat deleted file mode 100644 index f55f6a368..000000000 Binary files a/src/Data/CRF_Database.mat and /dev/null differ diff --git a/src/Data/CRF_observed.mat b/src/Data/CRF_observed.mat deleted file mode 100644 index 4d5f39e38..000000000 Binary files a/src/Data/CRF_observed.mat and /dev/null differ diff --git a/src/Import/eyelink/import_eyelink.m b/src/Import/eyelink/import_eyelink.m index f04e46ea3..44a391b1b 100644 --- a/src/Import/eyelink/import_eyelink.m +++ b/src/Import/eyelink/import_eyelink.m @@ -41,7 +41,7 @@ % parse datafile % -------------- - bsearch_path = pspm_path('backroom', 'bsearch'); + bsearch_path = pspm_path('ext', 'bsearch'); addpath(bsearch_path); [dataraw, messages, chan_info, file_info] = parse_eyelink_file(filepath); markers_sess = {}; @@ -299,9 +299,14 @@ msgline = messages{idx}; parts = split(msgline); time = str2num(parts{2}); - markers.markers(bsearch(timecol, time)) = true; - markers.times(end + 1, 1) = time; - markers.names{end + 1, 1} = cell2mat(join(parts(3:end), ' ')); + if ismember(time,markers.times) + warning('ID:markers_with_same_timestamp',['PsPM found markers with same timestamps.',... + 'Only the first one will be imported.']) + elseif time <= session_end_time + markers.markers(bsearch(timecol, time)) = true; + markers.times(end + 1, 1) = time; + markers.names{end + 1, 1} = cell2mat(join(parts(3:end), ' ')); + end end % set data columns diff --git a/src/Import/smi/import_smi.m b/src/Import/smi/import_smi.m index 8ffc18d02..48fba045e 100644 --- a/src/Import/smi/import_smi.m +++ b/src/Import/smi/import_smi.m @@ -237,7 +237,7 @@ data = cell(n_sessions, 1); %% convert data, compute blink, saccade and messages - bsearch_path = fullfile(fileparts(which('import_smi')), '..', '..', 'backroom', 'bsearch'); + bsearch_path = pspm_path('ext', 'bsearch'); addpath(bsearch_path); for sn = 1:n_sessions data{sn} = struct(); diff --git a/src/Import/smi/read_smi_events.m b/src/Import/smi/read_smi_events.m index f1c829f2e..7ae97046a 100644 --- a/src/Import/smi/read_smi_events.m +++ b/src/Import/smi/read_smi_events.m @@ -38,7 +38,7 @@ %__________________________________________________________________________ % % (C) 2019 Eshref Yozdemir - bsearch_path = pspm_path('backroom', 'bsearch'); + bsearch_path = pspm_path('ext', 'bsearch'); addpath(bsearch_path); if ~exist(filepath,'file') diff --git a/src/Import/viewpoint/import_viewpoint.m b/src/Import/viewpoint/import_viewpoint.m index e9ac03bca..f289f8eb1 100644 --- a/src/Import/viewpoint/import_viewpoint.m +++ b/src/Import/viewpoint/import_viewpoint.m @@ -36,7 +36,7 @@ % (C) 2019 Laure Ciernik % Function inspired by GazeAlyze �.. Most parts rewritten by Eshref Yozdemir to handle % newer ViewPoint files. - bsearch_path = fullfile(fileparts(which('import_viewpoint')), '..', '..', 'backroom', 'bsearch'); + bsearch_path = pspm_path('ext', 'bsearch'); addpath(bsearch_path); if ~exist(filepath,'file') diff --git a/src/backroom/SCR_f_amplitude_check.m b/src/backroom/SCR_f_amplitude_check.m index 8dc59e5db..953ebc9d9 100644 --- a/src/backroom/SCR_f_amplitude_check.m +++ b/src/backroom/SCR_f_amplitude_check.m @@ -102,8 +102,8 @@ scr = Y; sr = 10; global settings - addpath([settings.path, 'DAVB']); - addpath([settings.path, 'DAVB', filesep, 'subfunctions']); + addpath(pspm_path('ext','VBA')); + addpath(pspm_path('ext','VBA','subfunctions')); options.fresp = 1/40; dcm = pspm_sf_dcm(scr, sr, options); diff --git a/src/SPM/Contents.m b/src/ext/SPM/Contents.m similarity index 100% rename from src/SPM/Contents.m rename to src/ext/SPM/Contents.m diff --git a/src/SPM/cfg_get_defaults.m b/src/ext/SPM/cfg_get_defaults.m similarity index 100% rename from src/SPM/cfg_get_defaults.m rename to src/ext/SPM/cfg_get_defaults.m diff --git a/src/SPM/cfg_getfile.m b/src/ext/SPM/cfg_getfile.m similarity index 100% rename from src/SPM/cfg_getfile.m rename to src/ext/SPM/cfg_getfile.m diff --git a/src/SPM/cfg_mlbatch_defaults.m b/src/ext/SPM/cfg_mlbatch_defaults.m similarity index 100% rename from src/SPM/cfg_mlbatch_defaults.m rename to src/ext/SPM/cfg_mlbatch_defaults.m diff --git a/src/SPM/spm.m b/src/ext/SPM/spm.m similarity index 100% rename from src/SPM/spm.m rename to src/ext/SPM/spm.m diff --git a/src/SPM/spm_Gpdf.m b/src/ext/SPM/spm_Gpdf.m similarity index 100% rename from src/SPM/spm_Gpdf.m rename to src/ext/SPM/spm_Gpdf.m diff --git a/src/SPM/spm_Interactive.fig b/src/ext/SPM/spm_Interactive.fig similarity index 100% rename from src/SPM/spm_Interactive.fig rename to src/ext/SPM/spm_Interactive.fig diff --git a/src/SPM/spm_Tcdf.m b/src/ext/SPM/spm_Tcdf.m similarity index 100% rename from src/SPM/spm_Tcdf.m rename to src/ext/SPM/spm_Tcdf.m diff --git a/src/SPM/spm_figure.m b/src/ext/SPM/spm_figure.m similarity index 100% rename from src/SPM/spm_figure.m rename to src/ext/SPM/spm_figure.m diff --git a/src/SPM/spm_file.m b/src/ext/SPM/spm_file.m similarity index 100% rename from src/SPM/spm_file.m rename to src/ext/SPM/spm_file.m diff --git a/src/SPM/spm_input.m b/src/ext/SPM/spm_input.m similarity index 100% rename from src/SPM/spm_input.m rename to src/ext/SPM/spm_input.m diff --git a/src/SPM/spm_orth.m b/src/ext/SPM/spm_orth.m similarity index 100% rename from src/SPM/spm_orth.m rename to src/ext/SPM/spm_orth.m diff --git a/src/SPM/spm_select.m b/src/ext/SPM/spm_select.m similarity index 100% rename from src/SPM/spm_select.m rename to src/ext/SPM/spm_select.m diff --git a/src/VBA/LICENSE b/src/ext/VBA/LICENSE similarity index 100% rename from src/VBA/LICENSE rename to src/ext/VBA/LICENSE diff --git a/src/VBA/README.md b/src/ext/VBA/README.md similarity index 100% rename from src/VBA/README.md rename to src/ext/VBA/README.md diff --git a/src/VBA/VBA_BMA.m b/src/ext/VBA/VBA_BMA.m similarity index 100% rename from src/VBA/VBA_BMA.m rename to src/ext/VBA/VBA_BMA.m diff --git a/src/VBA/VBA_Bin2Cont.m b/src/ext/VBA/VBA_Bin2Cont.m similarity index 100% rename from src/VBA/VBA_Bin2Cont.m rename to src/ext/VBA/VBA_Bin2Cont.m diff --git a/src/VBA/VBA_EKF.m b/src/ext/VBA/VBA_EKF.m similarity index 100% rename from src/VBA/VBA_EKF.m rename to src/ext/VBA/VBA_EKF.m diff --git a/src/VBA/VBA_ElogBeta.m b/src/ext/VBA/VBA_ElogBeta.m similarity index 100% rename from src/VBA/VBA_ElogBeta.m rename to src/ext/VBA/VBA_ElogBeta.m diff --git a/src/VBA/VBA_ExceedanceProb.m b/src/ext/VBA/VBA_ExceedanceProb.m similarity index 100% rename from src/VBA/VBA_ExceedanceProb.m rename to src/ext/VBA/VBA_ExceedanceProb.m diff --git a/src/VBA/VBA_FreeEnergy.m b/src/ext/VBA/VBA_FreeEnergy.m similarity index 100% rename from src/VBA/VBA_FreeEnergy.m rename to src/ext/VBA/VBA_FreeEnergy.m diff --git a/src/VBA/VBA_FreeEnergy_UNL.m b/src/ext/VBA/VBA_FreeEnergy_UNL.m similarity index 100% rename from src/VBA/VBA_FreeEnergy_UNL.m rename to src/ext/VBA/VBA_FreeEnergy_UNL.m diff --git a/src/VBA/VBA_GN.m b/src/ext/VBA/VBA_GN.m similarity index 100% rename from src/VBA/VBA_GN.m rename to src/ext/VBA/VBA_GN.m diff --git a/src/VBA/VBA_Hpost.m b/src/ext/VBA/VBA_Hpost.m similarity index 100% rename from src/VBA/VBA_Hpost.m rename to src/ext/VBA/VBA_Hpost.m diff --git a/src/VBA/VBA_IX0.m b/src/ext/VBA/VBA_IX0.m similarity index 100% rename from src/VBA/VBA_IX0.m rename to src/ext/VBA/VBA_IX0.m diff --git a/src/VBA/VBA_IX_lagged.m b/src/ext/VBA/VBA_IX_lagged.m similarity index 100% rename from src/VBA/VBA_IX_lagged.m rename to src/ext/VBA/VBA_IX_lagged.m diff --git a/src/VBA/VBA_IX_lagged_binomial.m b/src/ext/VBA/VBA_IX_lagged_binomial.m similarity index 100% rename from src/VBA/VBA_IX_lagged_binomial.m rename to src/ext/VBA/VBA_IX_lagged_binomial.m diff --git a/src/VBA/VBA_Initialize.m b/src/ext/VBA/VBA_Initialize.m similarity index 100% rename from src/VBA/VBA_Initialize.m rename to src/ext/VBA/VBA_Initialize.m diff --git a/src/VBA/VBA_Iphi.m b/src/ext/VBA/VBA_Iphi.m similarity index 100% rename from src/VBA/VBA_Iphi.m rename to src/ext/VBA/VBA_Iphi.m diff --git a/src/VBA/VBA_Iphi_UNL.m b/src/ext/VBA/VBA_Iphi_UNL.m similarity index 100% rename from src/VBA/VBA_Iphi_UNL.m rename to src/ext/VBA/VBA_Iphi_UNL.m diff --git a/src/VBA/VBA_Iphi_binomial.m b/src/ext/VBA/VBA_Iphi_binomial.m similarity index 100% rename from src/VBA/VBA_Iphi_binomial.m rename to src/ext/VBA/VBA_Iphi_binomial.m diff --git a/src/VBA/VBA_Iphi_extended.m b/src/ext/VBA/VBA_Iphi_extended.m similarity index 100% rename from src/VBA/VBA_Iphi_extended.m rename to src/ext/VBA/VBA_Iphi_extended.m diff --git a/src/VBA/VBA_Iphi_split.m b/src/ext/VBA/VBA_Iphi_split.m similarity index 100% rename from src/VBA/VBA_Iphi_split.m rename to src/ext/VBA/VBA_Iphi_split.m diff --git a/src/VBA/VBA_Itheta.m b/src/ext/VBA/VBA_Itheta.m similarity index 100% rename from src/VBA/VBA_Itheta.m rename to src/ext/VBA/VBA_Itheta.m diff --git a/src/VBA/VBA_JensenShannon.m b/src/ext/VBA/VBA_JensenShannon.m similarity index 100% rename from src/VBA/VBA_JensenShannon.m rename to src/ext/VBA/VBA_JensenShannon.m diff --git a/src/VBA/VBA_KL.m b/src/ext/VBA/VBA_KL.m similarity index 100% rename from src/VBA/VBA_KL.m rename to src/ext/VBA/VBA_KL.m diff --git a/src/VBA/VBA_LMEH0.m b/src/ext/VBA/VBA_LMEH0.m similarity index 100% rename from src/VBA/VBA_LMEH0.m rename to src/ext/VBA/VBA_LMEH0.m diff --git a/src/VBA/VBA_MFX.m b/src/ext/VBA/VBA_MFX.m similarity index 100% rename from src/VBA/VBA_MFX.m rename to src/ext/VBA/VBA_MFX.m diff --git a/src/VBA/VBA_NLStateSpaceModel.m b/src/ext/VBA/VBA_NLStateSpaceModel.m similarity index 100% rename from src/VBA/VBA_NLStateSpaceModel.m rename to src/ext/VBA/VBA_NLStateSpaceModel.m diff --git a/src/VBA/VBA_PPM.m b/src/ext/VBA/VBA_PPM.m similarity index 100% rename from src/VBA/VBA_PPM.m rename to src/ext/VBA/VBA_PPM.m diff --git a/src/VBA/VBA_ReDisplay.m b/src/ext/VBA/VBA_ReDisplay.m similarity index 100% rename from src/VBA/VBA_ReDisplay.m rename to src/ext/VBA/VBA_ReDisplay.m diff --git a/src/VBA/VBA_SavageDickey.m b/src/ext/VBA/VBA_SavageDickey.m similarity index 100% rename from src/VBA/VBA_SavageDickey.m rename to src/ext/VBA/VBA_SavageDickey.m diff --git a/src/VBA/VBA_Shapley.m b/src/ext/VBA/VBA_Shapley.m similarity index 100% rename from src/VBA/VBA_Shapley.m rename to src/ext/VBA/VBA_Shapley.m diff --git a/src/VBA/VBA_UNL0.m b/src/ext/VBA/VBA_UNL0.m similarity index 100% rename from src/VBA/VBA_UNL0.m rename to src/ext/VBA/VBA_UNL0.m diff --git a/src/VBA/VBA_UNLtemp.m b/src/ext/VBA/VBA_UNLtemp.m similarity index 100% rename from src/VBA/VBA_UNLtemp.m rename to src/ext/VBA/VBA_UNLtemp.m diff --git a/src/VBA/VBA_VarParam.m b/src/ext/VBA/VBA_VarParam.m similarity index 100% rename from src/VBA/VBA_VarParam.m rename to src/ext/VBA/VBA_VarParam.m diff --git a/src/VBA/VBA_VolterraKernels.m b/src/ext/VBA/VBA_VolterraKernels.m similarity index 100% rename from src/VBA/VBA_VolterraKernels.m rename to src/ext/VBA/VBA_VolterraKernels.m diff --git a/src/VBA/VBA_bDCM_lesion.m b/src/ext/VBA/VBA_bDCM_lesion.m similarity index 100% rename from src/VBA/VBA_bDCM_lesion.m rename to src/ext/VBA/VBA_bDCM_lesion.m diff --git a/src/VBA/VBA_check.m b/src/ext/VBA/VBA_check.m similarity index 100% rename from src/VBA/VBA_check.m rename to src/ext/VBA/VBA_check.m diff --git a/src/VBA/VBA_check4DCM.m b/src/ext/VBA/VBA_check4DCM.m similarity index 100% rename from src/VBA/VBA_check4DCM.m rename to src/ext/VBA/VBA_check4DCM.m diff --git a/src/VBA/VBA_checkGN.m b/src/ext/VBA/VBA_checkGN.m similarity index 100% rename from src/VBA/VBA_checkGN.m rename to src/ext/VBA/VBA_checkGN.m diff --git a/src/VBA/VBA_check_errors.m b/src/ext/VBA/VBA_check_errors.m similarity index 100% rename from src/VBA/VBA_check_errors.m rename to src/ext/VBA/VBA_check_errors.m diff --git a/src/VBA/VBA_conv2glm.m b/src/ext/VBA/VBA_conv2glm.m similarity index 100% rename from src/VBA/VBA_conv2glm.m rename to src/ext/VBA/VBA_conv2glm.m diff --git a/src/VBA/VBA_dcmMatrices.m b/src/ext/VBA/VBA_dcmMatrices.m similarity index 100% rename from src/VBA/VBA_dcmMatrices.m rename to src/ext/VBA/VBA_dcmMatrices.m diff --git a/src/VBA/VBA_designEfficiency.m b/src/ext/VBA/VBA_designEfficiency.m similarity index 100% rename from src/VBA/VBA_designEfficiency.m rename to src/ext/VBA/VBA_designEfficiency.m diff --git a/src/VBA/VBA_disp.m b/src/ext/VBA/VBA_disp.m similarity index 100% rename from src/VBA/VBA_disp.m rename to src/ext/VBA/VBA_disp.m diff --git a/src/VBA/VBA_displayGrads.m b/src/ext/VBA/VBA_displayGrads.m similarity index 100% rename from src/VBA/VBA_displayGrads.m rename to src/ext/VBA/VBA_displayGrads.m diff --git a/src/VBA/VBA_displayGroupBMC.m b/src/ext/VBA/VBA_displayGroupBMC.m similarity index 100% rename from src/VBA/VBA_displayGroupBMC.m rename to src/ext/VBA/VBA_displayGroupBMC.m diff --git a/src/VBA/VBA_displayGroupBMCbtw.m b/src/ext/VBA/VBA_displayGroupBMCbtw.m similarity index 100% rename from src/VBA/VBA_displayGroupBMCbtw.m rename to src/ext/VBA/VBA_displayGroupBMCbtw.m diff --git a/src/VBA/VBA_displayMFX.m b/src/ext/VBA/VBA_displayMFX.m similarity index 100% rename from src/VBA/VBA_displayMFX.m rename to src/ext/VBA/VBA_displayMFX.m diff --git a/src/VBA/VBA_evalAL.m b/src/ext/VBA/VBA_evalAL.m similarity index 100% rename from src/VBA/VBA_evalAL.m rename to src/ext/VBA/VBA_evalAL.m diff --git a/src/VBA/VBA_evalAL2.m b/src/ext/VBA/VBA_evalAL2.m similarity index 100% rename from src/VBA/VBA_evalAL2.m rename to src/ext/VBA/VBA_evalAL2.m diff --git a/src/VBA/VBA_evalFun.m b/src/ext/VBA/VBA_evalFun.m similarity index 100% rename from src/VBA/VBA_evalFun.m rename to src/ext/VBA/VBA_evalFun.m diff --git a/src/VBA/VBA_fit.m b/src/ext/VBA/VBA_fit.m similarity index 100% rename from src/VBA/VBA_fit.m rename to src/ext/VBA/VBA_fit.m diff --git a/src/VBA/VBA_getDefaults.m b/src/ext/VBA/VBA_getDefaults.m similarity index 100% rename from src/VBA/VBA_getDefaults.m rename to src/ext/VBA/VBA_getDefaults.m diff --git a/src/VBA/VBA_getDiagnostics.m b/src/ext/VBA/VBA_getDiagnostics.m similarity index 100% rename from src/VBA/VBA_getDiagnostics.m rename to src/ext/VBA/VBA_getDiagnostics.m diff --git a/src/VBA/VBA_getISqrtMat.m b/src/ext/VBA/VBA_getISqrtMat.m similarity index 100% rename from src/VBA/VBA_getISqrtMat.m rename to src/ext/VBA/VBA_getISqrtMat.m diff --git a/src/VBA/VBA_getKernels.m b/src/ext/VBA/VBA_getKernels.m similarity index 100% rename from src/VBA/VBA_getKernels.m rename to src/ext/VBA/VBA_getKernels.m diff --git a/src/VBA/VBA_getLaplace.m b/src/ext/VBA/VBA_getLaplace.m similarity index 100% rename from src/VBA/VBA_getLaplace.m rename to src/ext/VBA/VBA_getLaplace.m diff --git a/src/VBA/VBA_getNoise.m b/src/ext/VBA/VBA_getNoise.m similarity index 100% rename from src/VBA/VBA_getNoise.m rename to src/ext/VBA/VBA_getNoise.m diff --git a/src/VBA/VBA_getNtuples.m b/src/ext/VBA/VBA_getNtuples.m similarity index 100% rename from src/VBA/VBA_getNtuples.m rename to src/ext/VBA/VBA_getNtuples.m diff --git a/src/VBA/VBA_getSuffStat.m b/src/ext/VBA/VBA_getSuffStat.m similarity index 100% rename from src/VBA/VBA_getSuffStat.m rename to src/ext/VBA/VBA_getSuffStat.m diff --git a/src/VBA/VBA_getU.m b/src/ext/VBA/VBA_getU.m similarity index 100% rename from src/VBA/VBA_getU.m rename to src/ext/VBA/VBA_getU.m diff --git a/src/VBA/VBA_getVar.m b/src/ext/VBA/VBA_getVar.m similarity index 100% rename from src/VBA/VBA_getVar.m rename to src/ext/VBA/VBA_getVar.m diff --git a/src/VBA/VBA_get_dL.m b/src/ext/VBA/VBA_get_dL.m similarity index 100% rename from src/VBA/VBA_get_dL.m rename to src/ext/VBA/VBA_get_dL.m diff --git a/src/VBA/VBA_get_tracker.m b/src/ext/VBA/VBA_get_tracker.m similarity index 100% rename from src/VBA/VBA_get_tracker.m rename to src/ext/VBA/VBA_get_tracker.m diff --git a/src/VBA/VBA_groupBMC.m b/src/ext/VBA/VBA_groupBMC.m similarity index 100% rename from src/VBA/VBA_groupBMC.m rename to src/ext/VBA/VBA_groupBMC.m diff --git a/src/VBA/VBA_groupBMC_btwConds.m b/src/ext/VBA/VBA_groupBMC_btwConds.m similarity index 100% rename from src/VBA/VBA_groupBMC_btwConds.m rename to src/ext/VBA/VBA_groupBMC_btwConds.m diff --git a/src/VBA/VBA_groupBMC_btwGroups.m b/src/ext/VBA/VBA_groupBMC_btwGroups.m similarity index 100% rename from src/VBA/VBA_groupBMC_btwGroups.m rename to src/ext/VBA/VBA_groupBMC_btwGroups.m diff --git a/src/VBA/VBA_groupBMCbtw.m b/src/ext/VBA/VBA_groupBMCbtw.m similarity index 100% rename from src/VBA/VBA_groupBMCbtw.m rename to src/ext/VBA/VBA_groupBMCbtw.m diff --git a/src/VBA/VBA_initDisplay.m b/src/ext/VBA/VBA_initDisplay.m similarity index 100% rename from src/VBA/VBA_initDisplay.m rename to src/ext/VBA/VBA_initDisplay.m diff --git a/src/VBA/VBA_initDisplay_extended.m b/src/ext/VBA/VBA_initDisplay_extended.m similarity index 100% rename from src/VBA/VBA_initDisplay_extended.m rename to src/ext/VBA/VBA_initDisplay_extended.m diff --git a/src/VBA/VBA_inv.m b/src/ext/VBA/VBA_inv.m similarity index 100% rename from src/VBA/VBA_inv.m rename to src/ext/VBA/VBA_inv.m diff --git a/src/VBA/VBA_logDet.m b/src/ext/VBA/VBA_logDet.m similarity index 100% rename from src/VBA/VBA_logDet.m rename to src/ext/VBA/VBA_logDet.m diff --git a/src/VBA/VBA_main.m b/src/ext/VBA/VBA_main.m similarity index 100% rename from src/VBA/VBA_main.m rename to src/ext/VBA/VBA_main.m diff --git a/src/VBA/VBA_microTime.m b/src/ext/VBA/VBA_microTime.m similarity index 100% rename from src/VBA/VBA_microTime.m rename to src/ext/VBA/VBA_microTime.m diff --git a/src/VBA/VBA_multisession_expand.m b/src/ext/VBA/VBA_multisession_expand.m similarity index 100% rename from src/VBA/VBA_multisession_expand.m rename to src/ext/VBA/VBA_multisession_expand.m diff --git a/src/VBA/VBA_multisession_factor.m b/src/ext/VBA/VBA_multisession_factor.m similarity index 100% rename from src/VBA/VBA_multisession_factor.m rename to src/ext/VBA/VBA_multisession_factor.m diff --git a/src/VBA/VBA_odeLim.m b/src/ext/VBA/VBA_odeLim.m similarity index 100% rename from src/VBA/VBA_odeLim.m rename to src/ext/VBA/VBA_odeLim.m diff --git a/src/VBA/VBA_odeLim2NLSS.m b/src/ext/VBA/VBA_odeLim2NLSS.m similarity index 100% rename from src/VBA/VBA_odeLim2NLSS.m rename to src/ext/VBA/VBA_odeLim2NLSS.m diff --git a/src/VBA/VBA_onlineWrapper.m b/src/ext/VBA/VBA_onlineWrapper.m similarity index 100% rename from src/VBA/VBA_onlineWrapper.m rename to src/ext/VBA/VBA_onlineWrapper.m diff --git a/src/VBA/VBA_optimPriors.m b/src/ext/VBA/VBA_optimPriors.m similarity index 100% rename from src/VBA/VBA_optimPriors.m rename to src/ext/VBA/VBA_optimPriors.m diff --git a/src/VBA/VBA_orth.m b/src/ext/VBA/VBA_orth.m similarity index 100% rename from src/VBA/VBA_orth.m rename to src/ext/VBA/VBA_orth.m diff --git a/src/VBA/VBA_pause.m b/src/ext/VBA/VBA_pause.m similarity index 100% rename from src/VBA/VBA_pause.m rename to src/ext/VBA/VBA_pause.m diff --git a/src/VBA/VBA_priors.m b/src/ext/VBA/VBA_priors.m similarity index 100% rename from src/VBA/VBA_priors.m rename to src/ext/VBA/VBA_priors.m diff --git a/src/VBA/VBA_psi.m b/src/ext/VBA/VBA_psi.m similarity index 100% rename from src/VBA/VBA_psi.m rename to src/ext/VBA/VBA_psi.m diff --git a/src/VBA/VBA_sample.m b/src/ext/VBA/VBA_sample.m similarity index 100% rename from src/VBA/VBA_sample.m rename to src/ext/VBA/VBA_sample.m diff --git a/src/VBA/VBA_setup.m b/src/ext/VBA/VBA_setup.m similarity index 100% rename from src/VBA/VBA_setup.m rename to src/ext/VBA/VBA_setup.m diff --git a/src/VBA/VBA_summary.m b/src/ext/VBA/VBA_summary.m similarity index 100% rename from src/VBA/VBA_summary.m rename to src/ext/VBA/VBA_summary.m diff --git a/src/VBA/VBA_summaryMFX.m b/src/ext/VBA/VBA_summaryMFX.m similarity index 100% rename from src/VBA/VBA_summaryMFX.m rename to src/ext/VBA/VBA_summaryMFX.m diff --git a/src/VBA/VBA_susceptibility.m b/src/ext/VBA/VBA_susceptibility.m similarity index 100% rename from src/VBA/VBA_susceptibility.m rename to src/ext/VBA/VBA_susceptibility.m diff --git a/src/VBA/VBA_updateDisplay.m b/src/ext/VBA/VBA_updateDisplay.m similarity index 100% rename from src/VBA/VBA_updateDisplay.m rename to src/ext/VBA/VBA_updateDisplay.m diff --git a/src/VBA/VBA_updateDisplay_extended.m b/src/ext/VBA/VBA_updateDisplay_extended.m similarity index 100% rename from src/VBA/VBA_updateDisplay_extended.m rename to src/ext/VBA/VBA_updateDisplay_extended.m diff --git a/src/VBA/VBA_version.m b/src/ext/VBA/VBA_version.m similarity index 100% rename from src/VBA/VBA_version.m rename to src/ext/VBA/VBA_version.m diff --git a/src/VBA/VBA_wrapup.m b/src/ext/VBA/VBA_wrapup.m similarity index 100% rename from src/VBA/VBA_wrapup.m rename to src/ext/VBA/VBA_wrapup.m diff --git a/src/VBA/checkGX_binomial.m b/src/ext/VBA/checkGX_binomial.m similarity index 100% rename from src/VBA/checkGX_binomial.m rename to src/ext/VBA/checkGX_binomial.m diff --git a/src/VBA/classification/BMM/MixtureOfBinomials.m b/src/ext/VBA/classification/BMM/MixtureOfBinomials.m similarity index 100% rename from src/VBA/classification/BMM/MixtureOfBinomials.m rename to src/ext/VBA/classification/BMM/MixtureOfBinomials.m diff --git a/src/VBA/classification/BMM/demo_BMM.m b/src/ext/VBA/classification/BMM/demo_BMM.m similarity index 100% rename from src/VBA/classification/BMM/demo_BMM.m rename to src/ext/VBA/classification/BMM/demo_BMM.m diff --git a/src/VBA/classification/BMM/generateBMM.m b/src/ext/VBA/classification/BMM/generateBMM.m similarity index 100% rename from src/VBA/classification/BMM/generateBMM.m rename to src/ext/VBA/classification/BMM/generateBMM.m diff --git a/src/VBA/classification/CRP/VB_CRP.m b/src/ext/VBA/classification/CRP/VB_CRP.m similarity index 100% rename from src/VBA/classification/CRP/VB_CRP.m rename to src/ext/VBA/classification/CRP/VB_CRP.m diff --git a/src/VBA/classification/CRP/demo_DP.m b/src/ext/VBA/classification/CRP/demo_DP.m similarity index 100% rename from src/VBA/classification/CRP/demo_DP.m rename to src/ext/VBA/classification/CRP/demo_DP.m diff --git a/src/VBA/classification/CRP/simulate_CRP.m b/src/ext/VBA/classification/CRP/simulate_CRP.m similarity index 100% rename from src/VBA/classification/CRP/simulate_CRP.m rename to src/ext/VBA/classification/CRP/simulate_CRP.m diff --git a/src/VBA/classification/GMM/PCA_MoG.m b/src/ext/VBA/classification/GMM/PCA_MoG.m similarity index 100% rename from src/VBA/classification/GMM/PCA_MoG.m rename to src/ext/VBA/classification/GMM/PCA_MoG.m diff --git a/src/VBA/classification/GMM/VBA_MoG.m b/src/ext/VBA/classification/GMM/VBA_MoG.m similarity index 100% rename from src/VBA/classification/GMM/VBA_MoG.m rename to src/ext/VBA/classification/GMM/VBA_MoG.m diff --git a/src/VBA/classification/GMM/VBA_projectMoG.m b/src/ext/VBA/classification/GMM/VBA_projectMoG.m similarity index 100% rename from src/VBA/classification/GMM/VBA_projectMoG.m rename to src/ext/VBA/classification/GMM/VBA_projectMoG.m diff --git a/src/VBA/classification/GMM/VBEM_GM.m b/src/ext/VBA/classification/GMM/VBEM_GM.m similarity index 100% rename from src/VBA/classification/GMM/VBEM_GM.m rename to src/ext/VBA/classification/GMM/VBEM_GM.m diff --git a/src/VBA/classification/GMM/demo_GMM.m b/src/ext/VBA/classification/GMM/demo_GMM.m similarity index 100% rename from src/VBA/classification/GMM/demo_GMM.m rename to src/ext/VBA/classification/GMM/demo_GMM.m diff --git a/src/VBA/classification/GMM/dist.m b/src/ext/VBA/classification/GMM/dist.m similarity index 100% rename from src/VBA/classification/GMM/dist.m rename to src/ext/VBA/classification/GMM/dist.m diff --git a/src/VBA/classification/GMM/generateGMM.m b/src/ext/VBA/classification/GMM/generateGMM.m similarity index 100% rename from src/VBA/classification/GMM/generateGMM.m rename to src/ext/VBA/classification/GMM/generateGMM.m diff --git a/src/VBA/classification/GMM/plotResults.m b/src/ext/VBA/classification/GMM/plotResults.m similarity index 100% rename from src/VBA/classification/GMM/plotResults.m rename to src/ext/VBA/classification/GMM/plotResults.m diff --git a/src/VBA/f_Id.m b/src/ext/VBA/f_Id.m similarity index 100% rename from src/VBA/f_Id.m rename to src/ext/VBA/f_Id.m diff --git a/src/VBA/f_embed.m b/src/ext/VBA/f_embed.m similarity index 100% rename from src/VBA/f_embed.m rename to src/ext/VBA/f_embed.m diff --git a/src/VBA/factorial_struct.m b/src/ext/VBA/factorial_struct.m similarity index 100% rename from src/VBA/factorial_struct.m rename to src/ext/VBA/factorial_struct.m diff --git a/src/VBA/g_conv0.m b/src/ext/VBA/g_conv0.m similarity index 100% rename from src/VBA/g_conv0.m rename to src/ext/VBA/g_conv0.m diff --git a/src/VBA/g_convSig.m b/src/ext/VBA/g_convSig.m similarity index 100% rename from src/VBA/g_convSig.m rename to src/ext/VBA/g_convSig.m diff --git a/src/VBA/g_embed.m b/src/ext/VBA/g_embed.m similarity index 100% rename from src/VBA/g_embed.m rename to src/ext/VBA/g_embed.m diff --git a/src/VBA/getF.m b/src/ext/VBA/getF.m similarity index 100% rename from src/VBA/getF.m rename to src/ext/VBA/getF.m diff --git a/src/VBA/getHyperpriors.m b/src/ext/VBA/getHyperpriors.m similarity index 100% rename from src/VBA/getHyperpriors.m rename to src/ext/VBA/getHyperpriors.m diff --git a/src/VBA/getKernels.m b/src/ext/VBA/getKernels.m similarity index 100% rename from src/VBA/getKernels.m rename to src/ext/VBA/getKernels.m diff --git a/src/VBA/getStateParamInput.m b/src/ext/VBA/getStateParamInput.m similarity index 100% rename from src/VBA/getStateParamInput.m rename to src/ext/VBA/getStateParamInput.m diff --git a/src/VBA/getSubplots.m b/src/ext/VBA/getSubplots.m similarity index 100% rename from src/VBA/getSubplots.m rename to src/ext/VBA/getSubplots.m diff --git a/src/VBA/get_MCMC_predictiveDensity.m b/src/ext/VBA/get_MCMC_predictiveDensity.m similarity index 100% rename from src/VBA/get_MCMC_predictiveDensity.m rename to src/ext/VBA/get_MCMC_predictiveDensity.m diff --git a/src/VBA/get_MCMC_predictiveDensity_fb.m b/src/ext/VBA/get_MCMC_predictiveDensity_fb.m similarity index 100% rename from src/VBA/get_MCMC_predictiveDensity_fb.m rename to src/ext/VBA/get_MCMC_predictiveDensity_fb.m diff --git a/src/VBA/isbinary.m b/src/ext/VBA/isbinary.m similarity index 100% rename from src/VBA/isbinary.m rename to src/ext/VBA/isbinary.m diff --git a/src/VBA/isweird.m b/src/ext/VBA/isweird.m similarity index 100% rename from src/VBA/isweird.m rename to src/ext/VBA/isweird.m diff --git a/src/VBA/numericDiff.m b/src/ext/VBA/numericDiff.m similarity index 100% rename from src/VBA/numericDiff.m rename to src/ext/VBA/numericDiff.m diff --git a/src/VBA/sampleFromArbitraryP.m b/src/ext/VBA/sampleFromArbitraryP.m similarity index 100% rename from src/VBA/sampleFromArbitraryP.m rename to src/ext/VBA/sampleFromArbitraryP.m diff --git a/src/VBA/setInput.m b/src/ext/VBA/setInput.m similarity index 100% rename from src/VBA/setInput.m rename to src/ext/VBA/setInput.m diff --git a/src/VBA/setPriors.m b/src/ext/VBA/setPriors.m similarity index 100% rename from src/VBA/setPriors.m rename to src/ext/VBA/setPriors.m diff --git a/src/VBA/simulateNLSS.m b/src/ext/VBA/simulateNLSS.m similarity index 100% rename from src/VBA/simulateNLSS.m rename to src/ext/VBA/simulateNLSS.m diff --git a/src/VBA/simulateNLSS_fb.m b/src/ext/VBA/simulateNLSS_fb.m similarity index 100% rename from src/VBA/simulateNLSS_fb.m rename to src/ext/VBA/simulateNLSS_fb.m diff --git a/src/VBA/stats&plots/Contrast_MEbins.m b/src/ext/VBA/stats&plots/Contrast_MEbins.m similarity index 100% rename from src/VBA/stats&plots/Contrast_MEbins.m rename to src/ext/VBA/stats&plots/Contrast_MEbins.m diff --git a/src/VBA/stats&plots/EVprodX.m b/src/ext/VBA/stats&plots/EVprodX.m similarity index 100% rename from src/VBA/stats&plots/EVprodX.m rename to src/ext/VBA/stats&plots/EVprodX.m diff --git a/src/VBA/stats&plots/GLM_contrast.m b/src/ext/VBA/stats&plots/GLM_contrast.m similarity index 100% rename from src/VBA/stats&plots/GLM_contrast.m rename to src/ext/VBA/stats&plots/GLM_contrast.m diff --git a/src/VBA/stats&plots/GLM_covComp.m b/src/ext/VBA/stats&plots/GLM_covComp.m similarity index 100% rename from src/VBA/stats&plots/GLM_covComp.m rename to src/ext/VBA/stats&plots/GLM_covComp.m diff --git a/src/VBA/stats&plots/MoveAxisToOrigin.m b/src/ext/VBA/stats&plots/MoveAxisToOrigin.m similarity index 100% rename from src/VBA/stats&plots/MoveAxisToOrigin.m rename to src/ext/VBA/stats&plots/MoveAxisToOrigin.m diff --git a/src/VBA/stats&plots/Plot3AxisAtOrigin.m b/src/ext/VBA/stats&plots/Plot3AxisAtOrigin.m similarity index 100% rename from src/VBA/stats&plots/Plot3AxisAtOrigin.m rename to src/ext/VBA/stats&plots/Plot3AxisAtOrigin.m diff --git a/src/VBA/stats&plots/PlotAxisAtOrigin.m b/src/ext/VBA/stats&plots/PlotAxisAtOrigin.m similarity index 100% rename from src/VBA/stats&plots/PlotAxisAtOrigin.m rename to src/ext/VBA/stats&plots/PlotAxisAtOrigin.m diff --git a/src/VBA/stats&plots/approxOnGrid.m b/src/ext/VBA/stats&plots/approxOnGrid.m similarity index 100% rename from src/VBA/stats&plots/approxOnGrid.m rename to src/ext/VBA/stats&plots/approxOnGrid.m diff --git a/src/VBA/stats&plots/cov2corr.m b/src/ext/VBA/stats&plots/cov2corr.m similarity index 100% rename from src/VBA/stats&plots/cov2corr.m rename to src/ext/VBA/stats&plots/cov2corr.m diff --git a/src/VBA/stats&plots/demo_GLM_missingData.m b/src/ext/VBA/stats&plots/demo_GLM_missingData.m similarity index 100% rename from src/VBA/stats&plots/demo_GLM_missingData.m rename to src/ext/VBA/stats&plots/demo_GLM_missingData.m diff --git a/src/VBA/stats&plots/demo_generalizability.m b/src/ext/VBA/stats&plots/demo_generalizability.m similarity index 100% rename from src/VBA/stats&plots/demo_generalizability.m rename to src/ext/VBA/stats&plots/demo_generalizability.m diff --git a/src/VBA/stats&plots/demo_mediation.m b/src/ext/VBA/stats&plots/demo_mediation.m similarity index 100% rename from src/VBA/stats&plots/demo_mediation.m rename to src/ext/VBA/stats&plots/demo_mediation.m diff --git a/src/VBA/stats&plots/displayUncertainSigmoid.m b/src/ext/VBA/stats&plots/displayUncertainSigmoid.m similarity index 100% rename from src/VBA/stats&plots/displayUncertainSigmoid.m rename to src/ext/VBA/stats&plots/displayUncertainSigmoid.m diff --git a/src/VBA/stats&plots/doROC.m b/src/ext/VBA/stats&plots/doROC.m similarity index 100% rename from src/VBA/stats&plots/doROC.m rename to src/ext/VBA/stats&plots/doROC.m diff --git a/src/VBA/stats&plots/empiricalHist.m b/src/ext/VBA/stats&plots/empiricalHist.m similarity index 100% rename from src/VBA/stats&plots/empiricalHist.m rename to src/ext/VBA/stats&plots/empiricalHist.m diff --git a/src/VBA/stats&plots/findCI.m b/src/ext/VBA/stats&plots/findCI.m similarity index 100% rename from src/VBA/stats&plots/findCI.m rename to src/ext/VBA/stats&plots/findCI.m diff --git a/src/VBA/stats&plots/fisher.m b/src/ext/VBA/stats&plots/fisher.m similarity index 100% rename from src/VBA/stats&plots/fisher.m rename to src/ext/VBA/stats&plots/fisher.m diff --git a/src/VBA/stats&plots/g_GLM_missingData.m b/src/ext/VBA/stats&plots/g_GLM_missingData.m similarity index 100% rename from src/VBA/stats&plots/g_GLM_missingData.m rename to src/ext/VBA/stats&plots/g_GLM_missingData.m diff --git a/src/VBA/stats&plots/getColors.m b/src/ext/VBA/stats&plots/getColors.m similarity index 100% rename from src/VBA/stats&plots/getColors.m rename to src/ext/VBA/stats&plots/getColors.m diff --git a/src/VBA/stats&plots/getPanel.m b/src/ext/VBA/stats&plots/getPanel.m similarity index 100% rename from src/VBA/stats&plots/getPanel.m rename to src/ext/VBA/stats&plots/getPanel.m diff --git a/src/VBA/stats&plots/hatch.m b/src/ext/VBA/stats&plots/hatch.m similarity index 100% rename from src/VBA/stats&plots/hatch.m rename to src/ext/VBA/stats&plots/hatch.m diff --git a/src/VBA/stats&plots/hist2.m b/src/ext/VBA/stats&plots/hist2.m similarity index 100% rename from src/VBA/stats&plots/hist2.m rename to src/ext/VBA/stats&plots/hist2.m diff --git a/src/VBA/stats&plots/invnormalcdf.m b/src/ext/VBA/stats&plots/invnormalcdf.m similarity index 100% rename from src/VBA/stats&plots/invnormalcdf.m rename to src/ext/VBA/stats&plots/invnormalcdf.m diff --git a/src/VBA/stats&plots/lev_GLM.m b/src/ext/VBA/stats&plots/lev_GLM.m similarity index 100% rename from src/VBA/stats&plots/lev_GLM.m rename to src/ext/VBA/stats&plots/lev_GLM.m diff --git a/src/VBA/stats&plots/maxMat.m b/src/ext/VBA/stats&plots/maxMat.m similarity index 100% rename from src/VBA/stats&plots/maxMat.m rename to src/ext/VBA/stats&plots/maxMat.m diff --git a/src/VBA/stats&plots/medianfilter0.m b/src/ext/VBA/stats&plots/medianfilter0.m similarity index 100% rename from src/VBA/stats&plots/medianfilter0.m rename to src/ext/VBA/stats&plots/medianfilter0.m diff --git a/src/VBA/stats&plots/mediationAnalysis0.m b/src/ext/VBA/stats&plots/mediationAnalysis0.m similarity index 100% rename from src/VBA/stats&plots/mediationAnalysis0.m rename to src/ext/VBA/stats&plots/mediationAnalysis0.m diff --git a/src/VBA/stats&plots/mnan.m b/src/ext/VBA/stats&plots/mnan.m similarity index 100% rename from src/VBA/stats&plots/mnan.m rename to src/ext/VBA/stats&plots/mnan.m diff --git a/src/VBA/stats&plots/nanzscore.m b/src/ext/VBA/stats&plots/nanzscore.m similarity index 100% rename from src/VBA/stats&plots/nanzscore.m rename to src/ext/VBA/stats&plots/nanzscore.m diff --git a/src/VBA/stats&plots/normalize.m b/src/ext/VBA/stats&plots/normalize.m similarity index 100% rename from src/VBA/stats&plots/normalize.m rename to src/ext/VBA/stats&plots/normalize.m diff --git a/src/VBA/stats&plots/normalpdf.m b/src/ext/VBA/stats&plots/normalpdf.m similarity index 100% rename from src/VBA/stats&plots/normalpdf.m rename to src/ext/VBA/stats&plots/normalpdf.m diff --git a/src/VBA/stats&plots/pinvComplex.m b/src/ext/VBA/stats&plots/pinvComplex.m similarity index 100% rename from src/VBA/stats&plots/pinvComplex.m rename to src/ext/VBA/stats&plots/pinvComplex.m diff --git a/src/VBA/stats&plots/plotDensity.m b/src/ext/VBA/stats&plots/plotDensity.m similarity index 100% rename from src/VBA/stats&plots/plotDensity.m rename to src/ext/VBA/stats&plots/plotDensity.m diff --git a/src/VBA/stats&plots/plotElipse.m b/src/ext/VBA/stats&plots/plotElipse.m similarity index 100% rename from src/VBA/stats&plots/plotElipse.m rename to src/ext/VBA/stats&plots/plotElipse.m diff --git a/src/VBA/stats&plots/plotGraph3D.m b/src/ext/VBA/stats&plots/plotGraph3D.m similarity index 100% rename from src/VBA/stats&plots/plotGraph3D.m rename to src/ext/VBA/stats&plots/plotGraph3D.m diff --git a/src/VBA/stats&plots/plotUncertainTimeSeries.m b/src/ext/VBA/stats&plots/plotUncertainTimeSeries.m similarity index 100% rename from src/VBA/stats&plots/plotUncertainTimeSeries.m rename to src/ext/VBA/stats&plots/plotUncertainTimeSeries.m diff --git a/src/VBA/stats&plots/plotVolterra.m b/src/ext/VBA/stats&plots/plotVolterra.m similarity index 100% rename from src/VBA/stats&plots/plotVolterra.m rename to src/ext/VBA/stats&plots/plotVolterra.m diff --git a/src/VBA/stats&plots/prodX.m b/src/ext/VBA/stats&plots/prodX.m similarity index 100% rename from src/VBA/stats&plots/prodX.m rename to src/ext/VBA/stats&plots/prodX.m diff --git a/src/VBA/stats&plots/smooth2.m b/src/ext/VBA/stats&plots/smooth2.m similarity index 100% rename from src/VBA/stats&plots/smooth2.m rename to src/ext/VBA/stats&plots/smooth2.m diff --git a/src/VBA/stats&plots/snan.m b/src/ext/VBA/stats&plots/snan.m similarity index 100% rename from src/VBA/stats&plots/snan.m rename to src/ext/VBA/stats&plots/snan.m diff --git a/src/VBA/stats&plots/spear.m b/src/ext/VBA/stats&plots/spear.m similarity index 100% rename from src/VBA/stats&plots/spear.m rename to src/ext/VBA/stats&plots/spear.m diff --git a/src/VBA/stats&plots/spm_autocorr.m b/src/ext/VBA/stats&plots/spm_autocorr.m similarity index 100% rename from src/VBA/stats&plots/spm_autocorr.m rename to src/ext/VBA/stats&plots/spm_autocorr.m diff --git a/src/VBA/stats&plots/spm_code/spm_Fcdf.m b/src/ext/VBA/stats&plots/spm_code/spm_Fcdf.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_Fcdf.m rename to src/ext/VBA/stats&plots/spm_code/spm_Fcdf.m diff --git a/src/VBA/stats&plots/spm_code/spm_Gpdf.m b/src/ext/VBA/stats&plots/spm_code/spm_Gpdf.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_Gpdf.m rename to src/ext/VBA/stats&plots/spm_code/spm_Gpdf.m diff --git a/src/VBA/stats&plots/spm_code/spm_Tcdf.m b/src/ext/VBA/stats&plots/spm_code/spm_Tcdf.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_Tcdf.m rename to src/ext/VBA/stats&plots/spm_code/spm_Tcdf.m diff --git a/src/VBA/stats&plots/spm_code/spm_Xadjust.m b/src/ext/VBA/stats&plots/spm_code/spm_Xadjust.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_Xadjust.m rename to src/ext/VBA/stats&plots/spm_code/spm_Xadjust.m diff --git a/src/VBA/stats&plots/spm_code/spm_dcm_build.m b/src/ext/VBA/stats&plots/spm_code/spm_dcm_build.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_dcm_build.m rename to src/ext/VBA/stats&plots/spm_code/spm_dcm_build.m diff --git a/src/VBA/stats&plots/spm_code/spm_dcm_explore.m b/src/ext/VBA/stats&plots/spm_code/spm_dcm_explore.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_dcm_explore.m rename to src/ext/VBA/stats&plots/spm_code/spm_dcm_explore.m diff --git a/src/VBA/stats&plots/spm_code/spm_dcm_fmri_check.m b/src/ext/VBA/stats&plots/spm_code/spm_dcm_fmri_check.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_dcm_fmri_check.m rename to src/ext/VBA/stats&plots/spm_code/spm_dcm_fmri_check.m diff --git a/src/VBA/stats&plots/spm_code/spm_dcm_graph.m b/src/ext/VBA/stats&plots/spm_code/spm_dcm_graph.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_dcm_graph.m rename to src/ext/VBA/stats&plots/spm_code/spm_dcm_graph.m diff --git a/src/VBA/stats&plots/spm_code/spm_gamrnd.c b/src/ext/VBA/stats&plots/spm_code/spm_gamrnd.c similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_gamrnd.c rename to src/ext/VBA/stats&plots/spm_code/spm_gamrnd.c diff --git a/src/VBA/stats&plots/spm_code/spm_gamrnd.m b/src/ext/VBA/stats&plots/spm_code/spm_gamrnd.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_gamrnd.m rename to src/ext/VBA/stats&plots/spm_code/spm_gamrnd.m diff --git a/src/VBA/stats&plots/spm_code/spm_gamrnd.mexa64 b/src/ext/VBA/stats&plots/spm_code/spm_gamrnd.mexa64 similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_gamrnd.mexa64 rename to src/ext/VBA/stats&plots/spm_code/spm_gamrnd.mexa64 diff --git a/src/VBA/stats&plots/spm_code/spm_gamrnd.mexglx b/src/ext/VBA/stats&plots/spm_code/spm_gamrnd.mexglx similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_gamrnd.mexglx rename to src/ext/VBA/stats&plots/spm_code/spm_gamrnd.mexglx diff --git a/src/VBA/stats&plots/spm_code/spm_gamrnd.mexmaci b/src/ext/VBA/stats&plots/spm_code/spm_gamrnd.mexmaci similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_gamrnd.mexmaci rename to src/ext/VBA/stats&plots/spm_code/spm_gamrnd.mexmaci diff --git a/src/VBA/stats&plots/spm_code/spm_gamrnd.mexmaci64 b/src/ext/VBA/stats&plots/spm_code/spm_gamrnd.mexmaci64 similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_gamrnd.mexmaci64 rename to src/ext/VBA/stats&plots/spm_code/spm_gamrnd.mexmaci64 diff --git a/src/VBA/stats&plots/spm_code/spm_gamrnd.mexw32 b/src/ext/VBA/stats&plots/spm_code/spm_gamrnd.mexw32 similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_gamrnd.mexw32 rename to src/ext/VBA/stats&plots/spm_code/spm_gamrnd.mexw32 diff --git a/src/VBA/stats&plots/spm_code/spm_gamrnd.mexw64 b/src/ext/VBA/stats&plots/spm_code/spm_gamrnd.mexw64 similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_gamrnd.mexw64 rename to src/ext/VBA/stats&plots/spm_code/spm_gamrnd.mexw64 diff --git a/src/VBA/stats&plots/spm_code/spm_hrf.m b/src/ext/VBA/stats&plots/spm_code/spm_hrf.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_hrf.m rename to src/ext/VBA/stats&plots/spm_code/spm_hrf.m diff --git a/src/VBA/stats&plots/spm_code/spm_inv.m b/src/ext/VBA/stats&plots/spm_code/spm_inv.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_inv.m rename to src/ext/VBA/stats&plots/spm_code/spm_inv.m diff --git a/src/VBA/stats&plots/spm_code/spm_log_evidence.m b/src/ext/VBA/stats&plots/spm_code/spm_log_evidence.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_log_evidence.m rename to src/ext/VBA/stats&plots/spm_code/spm_log_evidence.m diff --git a/src/VBA/stats&plots/spm_code/spm_logdet.m b/src/ext/VBA/stats&plots/spm_code/spm_logdet.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_logdet.m rename to src/ext/VBA/stats&plots/spm_code/spm_logdet.m diff --git a/src/VBA/stats&plots/spm_code/spm_unvec.m b/src/ext/VBA/stats&plots/spm_code/spm_unvec.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_unvec.m rename to src/ext/VBA/stats&plots/spm_code/spm_unvec.m diff --git a/src/VBA/stats&plots/spm_code/spm_vec.m b/src/ext/VBA/stats&plots/spm_code/spm_vec.m similarity index 100% rename from src/VBA/stats&plots/spm_code/spm_vec.m rename to src/ext/VBA/stats&plots/spm_code/spm_vec.m diff --git a/src/VBA/stats&plots/spm_dcm_batch.m b/src/ext/VBA/stats&plots/spm_dcm_batch.m similarity index 100% rename from src/VBA/stats&plots/spm_dcm_batch.m rename to src/ext/VBA/stats&plots/spm_dcm_batch.m diff --git a/src/VBA/stats&plots/spm_dcm_clone.m b/src/ext/VBA/stats&plots/spm_dcm_clone.m similarity index 100% rename from src/VBA/stats&plots/spm_dcm_clone.m rename to src/ext/VBA/stats&plots/spm_dcm_clone.m diff --git a/src/VBA/stats&plots/spm_dcm_test.m b/src/ext/VBA/stats&plots/spm_dcm_test.m similarity index 100% rename from src/VBA/stats&plots/spm_dcm_test.m rename to src/ext/VBA/stats&plots/spm_dcm_test.m diff --git a/src/VBA/stats&plots/spm_deconv.m b/src/ext/VBA/stats&plots/spm_deconv.m similarity index 100% rename from src/VBA/stats&plots/spm_deconv.m rename to src/ext/VBA/stats&plots/spm_deconv.m diff --git a/src/VBA/stats&plots/spm_getSNR.m b/src/ext/VBA/stats&plots/spm_getSNR.m similarity index 100% rename from src/VBA/stats&plots/spm_getSNR.m rename to src/ext/VBA/stats&plots/spm_getSNR.m diff --git a/src/VBA/stats&plots/spm_resample.m b/src/ext/VBA/stats&plots/spm_resample.m similarity index 100% rename from src/VBA/stats&plots/spm_resample.m rename to src/ext/VBA/stats&plots/spm_resample.m diff --git a/src/VBA/stats&plots/spm_split_dcm.m b/src/ext/VBA/stats&plots/spm_split_dcm.m similarity index 100% rename from src/VBA/stats&plots/spm_split_dcm.m rename to src/ext/VBA/stats&plots/spm_split_dcm.m diff --git a/src/VBA/stats&plots/spm_uitab.m b/src/ext/VBA/stats&plots/spm_uitab.m similarity index 100% rename from src/VBA/stats&plots/spm_uitab.m rename to src/ext/VBA/stats&plots/spm_uitab.m diff --git a/src/VBA/subfunctions/Av.m b/src/ext/VBA/subfunctions/Av.m similarity index 100% rename from src/VBA/subfunctions/Av.m rename to src/ext/VBA/subfunctions/Av.m diff --git a/src/VBA/subfunctions/BOLD_parameters.m b/src/ext/VBA/subfunctions/BOLD_parameters.m similarity index 100% rename from src/VBA/subfunctions/BOLD_parameters.m rename to src/ext/VBA/subfunctions/BOLD_parameters.m diff --git a/src/VBA/subfunctions/Contrast_MEbins.m b/src/ext/VBA/subfunctions/Contrast_MEbins.m similarity index 100% rename from src/VBA/subfunctions/Contrast_MEbins.m rename to src/ext/VBA/subfunctions/Contrast_MEbins.m diff --git a/src/VBA/subfunctions/ERP_dcm.m b/src/ext/VBA/subfunctions/ERP_dcm.m similarity index 100% rename from src/VBA/subfunctions/ERP_dcm.m rename to src/ext/VBA/subfunctions/ERP_dcm.m diff --git a/src/VBA/subfunctions/GaussNewton.m b/src/ext/VBA/subfunctions/GaussNewton.m similarity index 100% rename from src/VBA/subfunctions/GaussNewton.m rename to src/ext/VBA/subfunctions/GaussNewton.m diff --git a/src/VBA/subfunctions/GetGitPath.m b/src/ext/VBA/subfunctions/GetGitPath.m similarity index 100% rename from src/VBA/subfunctions/GetGitPath.m rename to src/ext/VBA/subfunctions/GetGitPath.m diff --git a/src/VBA/subfunctions/ObsRecGen.m b/src/ext/VBA/subfunctions/ObsRecGen.m similarity index 100% rename from src/VBA/subfunctions/ObsRecGen.m rename to src/ext/VBA/subfunctions/ObsRecGen.m diff --git a/src/VBA/subfunctions/RecToMfunction.m b/src/ext/VBA/subfunctions/RecToMfunction.m similarity index 100% rename from src/VBA/subfunctions/RecToMfunction.m rename to src/ext/VBA/subfunctions/RecToMfunction.m diff --git a/src/VBA/subfunctions/U_dummy.m b/src/ext/VBA/subfunctions/U_dummy.m similarity index 100% rename from src/VBA/subfunctions/U_dummy.m rename to src/ext/VBA/subfunctions/U_dummy.m diff --git a/src/VBA/subfunctions/VarVolatility.m b/src/ext/VBA/subfunctions/VarVolatility.m similarity index 100% rename from src/VBA/subfunctions/VarVolatility.m rename to src/ext/VBA/subfunctions/VarVolatility.m diff --git a/src/VBA/subfunctions/addConfounds2dcm.m b/src/ext/VBA/subfunctions/addConfounds2dcm.m similarity index 100% rename from src/VBA/subfunctions/addConfounds2dcm.m rename to src/ext/VBA/subfunctions/addConfounds2dcm.m diff --git a/src/VBA/subfunctions/balanced_accuracy.m b/src/ext/VBA/subfunctions/balanced_accuracy.m similarity index 100% rename from src/VBA/subfunctions/balanced_accuracy.m rename to src/ext/VBA/subfunctions/balanced_accuracy.m diff --git a/src/VBA/subfunctions/bernoulli.m b/src/ext/VBA/subfunctions/bernoulli.m similarity index 100% rename from src/VBA/subfunctions/bernoulli.m rename to src/ext/VBA/subfunctions/bernoulli.m diff --git a/src/VBA/subfunctions/checkF.m b/src/ext/VBA/subfunctions/checkF.m similarity index 100% rename from src/VBA/subfunctions/checkF.m rename to src/ext/VBA/subfunctions/checkF.m diff --git a/src/VBA/subfunctions/check_constrasts.m b/src/ext/VBA/subfunctions/check_constrasts.m similarity index 100% rename from src/VBA/subfunctions/check_constrasts.m rename to src/ext/VBA/subfunctions/check_constrasts.m diff --git a/src/VBA/subfunctions/check_struct.m b/src/ext/VBA/subfunctions/check_struct.m similarity index 100% rename from src/VBA/subfunctions/check_struct.m rename to src/ext/VBA/subfunctions/check_struct.m diff --git a/src/VBA/subfunctions/compHRFs.m b/src/ext/VBA/subfunctions/compHRFs.m similarity index 100% rename from src/VBA/subfunctions/compHRFs.m rename to src/ext/VBA/subfunctions/compHRFs.m diff --git a/src/VBA/subfunctions/comparePredictions.m b/src/ext/VBA/subfunctions/comparePredictions.m similarity index 100% rename from src/VBA/subfunctions/comparePredictions.m rename to src/ext/VBA/subfunctions/comparePredictions.m diff --git a/src/VBA/subfunctions/compare_struct.m b/src/ext/VBA/subfunctions/compare_struct.m similarity index 100% rename from src/VBA/subfunctions/compare_struct.m rename to src/ext/VBA/subfunctions/compare_struct.m diff --git a/src/VBA/subfunctions/create2dbf.m b/src/ext/VBA/subfunctions/create2dbf.m similarity index 100% rename from src/VBA/subfunctions/create2dbf.m rename to src/ext/VBA/subfunctions/create2dbf.m diff --git a/src/VBA/subfunctions/dMatdvec.m b/src/ext/VBA/subfunctions/dMatdvec.m similarity index 100% rename from src/VBA/subfunctions/dMatdvec.m rename to src/ext/VBA/subfunctions/dMatdvec.m diff --git a/src/VBA/subfunctions/dcm2vba.m b/src/ext/VBA/subfunctions/dcm2vba.m similarity index 100% rename from src/VBA/subfunctions/dcm2vba.m rename to src/ext/VBA/subfunctions/dcm2vba.m diff --git a/src/VBA/subfunctions/defIndlev.m b/src/ext/VBA/subfunctions/defIndlev.m similarity index 100% rename from src/VBA/subfunctions/defIndlev.m rename to src/ext/VBA/subfunctions/defIndlev.m diff --git a/src/VBA/subfunctions/defaultHRFparams.m b/src/ext/VBA/subfunctions/defaultHRFparams.m similarity index 100% rename from src/VBA/subfunctions/defaultHRFparams.m rename to src/ext/VBA/subfunctions/defaultHRFparams.m diff --git a/src/VBA/subfunctions/demo_2DChoices.m b/src/ext/VBA/subfunctions/demo_2DChoices.m similarity index 100% rename from src/VBA/subfunctions/demo_2DChoices.m rename to src/ext/VBA/subfunctions/demo_2DChoices.m diff --git a/src/VBA/subfunctions/demo_2Dlin.m b/src/ext/VBA/subfunctions/demo_2Dlin.m similarity index 100% rename from src/VBA/subfunctions/demo_2Dlin.m rename to src/ext/VBA/subfunctions/demo_2Dlin.m diff --git a/src/VBA/subfunctions/demo_2DneuralField.m b/src/ext/VBA/subfunctions/demo_2DneuralField.m similarity index 100% rename from src/VBA/subfunctions/demo_2DneuralField.m rename to src/ext/VBA/subfunctions/demo_2DneuralField.m diff --git a/src/VBA/subfunctions/demo_AR1.m b/src/ext/VBA/subfunctions/demo_AR1.m similarity index 100% rename from src/VBA/subfunctions/demo_AR1.m rename to src/ext/VBA/subfunctions/demo_AR1.m diff --git a/src/VBA/subfunctions/demo_AVL_recog.m b/src/ext/VBA/subfunctions/demo_AVL_recog.m similarity index 100% rename from src/VBA/subfunctions/demo_AVL_recog.m rename to src/ext/VBA/subfunctions/demo_AVL_recog.m diff --git a/src/VBA/subfunctions/demo_CI.m b/src/ext/VBA/subfunctions/demo_CI.m similarity index 100% rename from src/VBA/subfunctions/demo_CI.m rename to src/ext/VBA/subfunctions/demo_CI.m diff --git a/src/VBA/subfunctions/demo_CaBBI_FHN.m b/src/ext/VBA/subfunctions/demo_CaBBI_FHN.m similarity index 100% rename from src/VBA/subfunctions/demo_CaBBI_FHN.m rename to src/ext/VBA/subfunctions/demo_CaBBI_FHN.m diff --git a/src/VBA/subfunctions/demo_CaBBI_QGIF.m b/src/ext/VBA/subfunctions/demo_CaBBI_QGIF.m similarity index 100% rename from src/VBA/subfunctions/demo_CaBBI_QGIF.m rename to src/ext/VBA/subfunctions/demo_CaBBI_QGIF.m diff --git a/src/VBA/subfunctions/demo_FHN.m b/src/ext/VBA/subfunctions/demo_FHN.m similarity index 100% rename from src/VBA/subfunctions/demo_FHN.m rename to src/ext/VBA/subfunctions/demo_FHN.m diff --git a/src/VBA/subfunctions/demo_GLM.m b/src/ext/VBA/subfunctions/demo_GLM.m similarity index 100% rename from src/VBA/subfunctions/demo_GLM.m rename to src/ext/VBA/subfunctions/demo_GLM.m diff --git a/src/VBA/subfunctions/demo_HH.m b/src/ext/VBA/subfunctions/demo_HH.m similarity index 100% rename from src/VBA/subfunctions/demo_HH.m rename to src/ext/VBA/subfunctions/demo_HH.m diff --git a/src/VBA/subfunctions/demo_HRF.m b/src/ext/VBA/subfunctions/demo_HRF.m similarity index 100% rename from src/VBA/subfunctions/demo_HRF.m rename to src/ext/VBA/subfunctions/demo_HRF.m diff --git a/src/VBA/subfunctions/demo_HRF_distributed.m b/src/ext/VBA/subfunctions/demo_HRF_distributed.m similarity index 100% rename from src/VBA/subfunctions/demo_HRF_distributed.m rename to src/ext/VBA/subfunctions/demo_HRF_distributed.m diff --git a/src/VBA/subfunctions/demo_HRF_dummy.m b/src/ext/VBA/subfunctions/demo_HRF_dummy.m similarity index 100% rename from src/VBA/subfunctions/demo_HRF_dummy.m rename to src/ext/VBA/subfunctions/demo_HRF_dummy.m diff --git a/src/VBA/subfunctions/demo_Henon.m b/src/ext/VBA/subfunctions/demo_Henon.m similarity index 100% rename from src/VBA/subfunctions/demo_Henon.m rename to src/ext/VBA/subfunctions/demo_Henon.m diff --git a/src/VBA/subfunctions/demo_HodgkinHuxley.m b/src/ext/VBA/subfunctions/demo_HodgkinHuxley.m similarity index 100% rename from src/VBA/subfunctions/demo_HodgkinHuxley.m rename to src/ext/VBA/subfunctions/demo_HodgkinHuxley.m diff --git a/src/VBA/subfunctions/demo_KalmanSmoother.m b/src/ext/VBA/subfunctions/demo_KalmanSmoother.m similarity index 100% rename from src/VBA/subfunctions/demo_KalmanSmoother.m rename to src/ext/VBA/subfunctions/demo_KalmanSmoother.m diff --git a/src/VBA/subfunctions/demo_LV2D.m b/src/ext/VBA/subfunctions/demo_LV2D.m similarity index 100% rename from src/VBA/subfunctions/demo_LV2D.m rename to src/ext/VBA/subfunctions/demo_LV2D.m diff --git a/src/VBA/subfunctions/demo_Lorenz.m b/src/ext/VBA/subfunctions/demo_Lorenz.m similarity index 100% rename from src/VBA/subfunctions/demo_Lorenz.m rename to src/ext/VBA/subfunctions/demo_Lorenz.m diff --git a/src/VBA/subfunctions/demo_MCsampling.m b/src/ext/VBA/subfunctions/demo_MCsampling.m similarity index 100% rename from src/VBA/subfunctions/demo_MCsampling.m rename to src/ext/VBA/subfunctions/demo_MCsampling.m diff --git a/src/VBA/subfunctions/demo_MFX.m b/src/ext/VBA/subfunctions/demo_MFX.m similarity index 100% rename from src/VBA/subfunctions/demo_MFX.m rename to src/ext/VBA/subfunctions/demo_MFX.m diff --git a/src/VBA/subfunctions/demo_Oscillatory.m b/src/ext/VBA/subfunctions/demo_Oscillatory.m similarity index 100% rename from src/VBA/subfunctions/demo_Oscillatory.m rename to src/ext/VBA/subfunctions/demo_Oscillatory.m diff --git a/src/VBA/subfunctions/demo_PSP.m b/src/ext/VBA/subfunctions/demo_PSP.m similarity index 100% rename from src/VBA/subfunctions/demo_PSP.m rename to src/ext/VBA/subfunctions/demo_PSP.m diff --git a/src/VBA/subfunctions/demo_Qlearning.m b/src/ext/VBA/subfunctions/demo_Qlearning.m similarity index 100% rename from src/VBA/subfunctions/demo_Qlearning.m rename to src/ext/VBA/subfunctions/demo_Qlearning.m diff --git a/src/VBA/subfunctions/demo_RFX.m b/src/ext/VBA/subfunctions/demo_RFX.m similarity index 100% rename from src/VBA/subfunctions/demo_RFX.m rename to src/ext/VBA/subfunctions/demo_RFX.m diff --git a/src/VBA/subfunctions/demo_Rossler.m b/src/ext/VBA/subfunctions/demo_Rossler.m similarity index 100% rename from src/VBA/subfunctions/demo_Rossler.m rename to src/ext/VBA/subfunctions/demo_Rossler.m diff --git a/src/VBA/subfunctions/demo_SHC.m b/src/ext/VBA/subfunctions/demo_SHC.m similarity index 100% rename from src/VBA/subfunctions/demo_SHC.m rename to src/ext/VBA/subfunctions/demo_SHC.m diff --git a/src/VBA/subfunctions/demo_VBfree.m b/src/ext/VBA/subfunctions/demo_VBfree.m similarity index 100% rename from src/VBA/subfunctions/demo_VBfree.m rename to src/ext/VBA/subfunctions/demo_VBfree.m diff --git a/src/VBA/subfunctions/demo_VanDerPol.m b/src/ext/VBA/subfunctions/demo_VanDerPol.m similarity index 100% rename from src/VBA/subfunctions/demo_VanDerPol.m rename to src/ext/VBA/subfunctions/demo_VanDerPol.m diff --git a/src/VBA/subfunctions/demo_asymRW.m b/src/ext/VBA/subfunctions/demo_asymRW.m similarity index 100% rename from src/VBA/subfunctions/demo_asymRW.m rename to src/ext/VBA/subfunctions/demo_asymRW.m diff --git a/src/VBA/subfunctions/demo_behaviouralDCM.m b/src/ext/VBA/subfunctions/demo_behaviouralDCM.m similarity index 100% rename from src/VBA/subfunctions/demo_behaviouralDCM.m rename to src/ext/VBA/subfunctions/demo_behaviouralDCM.m diff --git a/src/VBA/subfunctions/demo_bin.m b/src/ext/VBA/subfunctions/demo_bin.m similarity index 100% rename from src/VBA/subfunctions/demo_bin.m rename to src/ext/VBA/subfunctions/demo_bin.m diff --git a/src/VBA/subfunctions/demo_binomial.m b/src/ext/VBA/subfunctions/demo_binomial.m similarity index 100% rename from src/VBA/subfunctions/demo_binomial.m rename to src/ext/VBA/subfunctions/demo_binomial.m diff --git a/src/VBA/subfunctions/demo_binomial_AdaptDesign.m b/src/ext/VBA/subfunctions/demo_binomial_AdaptDesign.m similarity index 100% rename from src/VBA/subfunctions/demo_binomial_AdaptDesign.m rename to src/ext/VBA/subfunctions/demo_binomial_AdaptDesign.m diff --git a/src/VBA/subfunctions/demo_binomial_adapt.m b/src/ext/VBA/subfunctions/demo_binomial_adapt.m similarity index 100% rename from src/VBA/subfunctions/demo_binomial_adapt.m rename to src/ext/VBA/subfunctions/demo_binomial_adapt.m diff --git a/src/VBA/subfunctions/demo_bmc4glm.m b/src/ext/VBA/subfunctions/demo_bmc4glm.m similarity index 100% rename from src/VBA/subfunctions/demo_bmc4glm.m rename to src/ext/VBA/subfunctions/demo_bmc4glm.m diff --git a/src/VBA/subfunctions/demo_classification.m b/src/ext/VBA/subfunctions/demo_classification.m similarity index 100% rename from src/VBA/subfunctions/demo_classification.m rename to src/ext/VBA/subfunctions/demo_classification.m diff --git a/src/VBA/subfunctions/demo_covComp.m b/src/ext/VBA/subfunctions/demo_covComp.m similarity index 100% rename from src/VBA/subfunctions/demo_covComp.m rename to src/ext/VBA/subfunctions/demo_covComp.m diff --git a/src/VBA/subfunctions/demo_dcm4fmri.m b/src/ext/VBA/subfunctions/demo_dcm4fmri.m similarity index 100% rename from src/VBA/subfunctions/demo_dcm4fmri.m rename to src/ext/VBA/subfunctions/demo_dcm4fmri.m diff --git a/src/VBA/subfunctions/demo_dcm4fmri_distributed.m b/src/ext/VBA/subfunctions/demo_dcm4fmri_distributed.m similarity index 100% rename from src/VBA/subfunctions/demo_dcm4fmri_distributed.m rename to src/ext/VBA/subfunctions/demo_dcm4fmri_distributed.m diff --git a/src/VBA/subfunctions/demo_dcm_1region.m b/src/ext/VBA/subfunctions/demo_dcm_1region.m similarity index 100% rename from src/VBA/subfunctions/demo_dcm_1region.m rename to src/ext/VBA/subfunctions/demo_dcm_1region.m diff --git a/src/VBA/subfunctions/demo_dcm_motorPremotor.m b/src/ext/VBA/subfunctions/demo_dcm_motorPremotor.m similarity index 100% rename from src/VBA/subfunctions/demo_dcm_motorPremotor.m rename to src/ext/VBA/subfunctions/demo_dcm_motorPremotor.m diff --git a/src/VBA/subfunctions/demo_dcmonline.m b/src/ext/VBA/subfunctions/demo_dcmonline.m similarity index 100% rename from src/VBA/subfunctions/demo_dcmonline.m rename to src/ext/VBA/subfunctions/demo_dcmonline.m diff --git a/src/VBA/subfunctions/demo_delays.m b/src/ext/VBA/subfunctions/demo_delays.m similarity index 100% rename from src/VBA/subfunctions/demo_delays.m rename to src/ext/VBA/subfunctions/demo_delays.m diff --git a/src/VBA/subfunctions/demo_discounting.m b/src/ext/VBA/subfunctions/demo_discounting.m similarity index 100% rename from src/VBA/subfunctions/demo_discounting.m rename to src/ext/VBA/subfunctions/demo_discounting.m diff --git a/src/VBA/subfunctions/demo_doubleWell.m b/src/ext/VBA/subfunctions/demo_doubleWell.m similarity index 100% rename from src/VBA/subfunctions/demo_doubleWell.m rename to src/ext/VBA/subfunctions/demo_doubleWell.m diff --git a/src/VBA/subfunctions/demo_dummyUNL.m b/src/ext/VBA/subfunctions/demo_dummyUNL.m similarity index 100% rename from src/VBA/subfunctions/demo_dummyUNL.m rename to src/ext/VBA/subfunctions/demo_dummyUNL.m diff --git a/src/VBA/subfunctions/demo_dynLearningRate.m b/src/ext/VBA/subfunctions/demo_dynLearningRate.m similarity index 100% rename from src/VBA/subfunctions/demo_dynLearningRate.m rename to src/ext/VBA/subfunctions/demo_dynLearningRate.m diff --git a/src/VBA/subfunctions/demo_dynsys.m b/src/ext/VBA/subfunctions/demo_dynsys.m similarity index 100% rename from src/VBA/subfunctions/demo_dynsys.m rename to src/ext/VBA/subfunctions/demo_dynsys.m diff --git a/src/VBA/subfunctions/demo_fitzhugh.m b/src/ext/VBA/subfunctions/demo_fitzhugh.m similarity index 100% rename from src/VBA/subfunctions/demo_fitzhugh.m rename to src/ext/VBA/subfunctions/demo_fitzhugh.m diff --git a/src/VBA/subfunctions/demo_gaussian.m b/src/ext/VBA/subfunctions/demo_gaussian.m similarity index 100% rename from src/VBA/subfunctions/demo_gaussian.m rename to src/ext/VBA/subfunctions/demo_gaussian.m diff --git a/src/VBA/subfunctions/demo_getConvKernel.m b/src/ext/VBA/subfunctions/demo_getConvKernel.m similarity index 100% rename from src/VBA/subfunctions/demo_getConvKernel.m rename to src/ext/VBA/subfunctions/demo_getConvKernel.m diff --git a/src/VBA/subfunctions/demo_groupbtw.m b/src/ext/VBA/subfunctions/demo_groupbtw.m similarity index 100% rename from src/VBA/subfunctions/demo_groupbtw.m rename to src/ext/VBA/subfunctions/demo_groupbtw.m diff --git a/src/VBA/subfunctions/demo_imageRegistration.m b/src/ext/VBA/subfunctions/demo_imageRegistration.m similarity index 100% rename from src/VBA/subfunctions/demo_imageRegistration.m rename to src/ext/VBA/subfunctions/demo_imageRegistration.m diff --git a/src/VBA/subfunctions/demo_interaction.m b/src/ext/VBA/subfunctions/demo_interaction.m similarity index 100% rename from src/VBA/subfunctions/demo_interaction.m rename to src/ext/VBA/subfunctions/demo_interaction.m diff --git a/src/VBA/subfunctions/demo_irregular.m b/src/ext/VBA/subfunctions/demo_irregular.m similarity index 100% rename from src/VBA/subfunctions/demo_irregular.m rename to src/ext/VBA/subfunctions/demo_irregular.m diff --git a/src/VBA/subfunctions/demo_lin2D.m b/src/ext/VBA/subfunctions/demo_lin2D.m similarity index 100% rename from src/VBA/subfunctions/demo_lin2D.m rename to src/ext/VBA/subfunctions/demo_lin2D.m diff --git a/src/VBA/subfunctions/demo_linear.m b/src/ext/VBA/subfunctions/demo_linear.m similarity index 100% rename from src/VBA/subfunctions/demo_linear.m rename to src/ext/VBA/subfunctions/demo_linear.m diff --git a/src/VBA/subfunctions/demo_logNormal.m b/src/ext/VBA/subfunctions/demo_logNormal.m similarity index 100% rename from src/VBA/subfunctions/demo_logNormal.m rename to src/ext/VBA/subfunctions/demo_logNormal.m diff --git a/src/VBA/subfunctions/demo_logistic.m b/src/ext/VBA/subfunctions/demo_logistic.m similarity index 100% rename from src/VBA/subfunctions/demo_logistic.m rename to src/ext/VBA/subfunctions/demo_logistic.m diff --git a/src/VBA/subfunctions/demo_micro2macro.m b/src/ext/VBA/subfunctions/demo_micro2macro.m similarity index 100% rename from src/VBA/subfunctions/demo_micro2macro.m rename to src/ext/VBA/subfunctions/demo_micro2macro.m diff --git a/src/VBA/subfunctions/demo_multisession.m b/src/ext/VBA/subfunctions/demo_multisession.m similarity index 100% rename from src/VBA/subfunctions/demo_multisession.m rename to src/ext/VBA/subfunctions/demo_multisession.m diff --git a/src/VBA/subfunctions/demo_multisource.m b/src/ext/VBA/subfunctions/demo_multisource.m similarity index 100% rename from src/VBA/subfunctions/demo_multisource.m rename to src/ext/VBA/subfunctions/demo_multisource.m diff --git a/src/VBA/subfunctions/demo_negfeedback.m b/src/ext/VBA/subfunctions/demo_negfeedback.m similarity index 100% rename from src/VBA/subfunctions/demo_negfeedback.m rename to src/ext/VBA/subfunctions/demo_negfeedback.m diff --git a/src/VBA/subfunctions/demo_nullSpace.m b/src/ext/VBA/subfunctions/demo_nullSpace.m similarity index 100% rename from src/VBA/subfunctions/demo_nullSpace.m rename to src/ext/VBA/subfunctions/demo_nullSpace.m diff --git a/src/VBA/subfunctions/demo_prodsig.m b/src/ext/VBA/subfunctions/demo_prodsig.m similarity index 100% rename from src/VBA/subfunctions/demo_prodsig.m rename to src/ext/VBA/subfunctions/demo_prodsig.m diff --git a/src/VBA/subfunctions/demo_recur.m b/src/ext/VBA/subfunctions/demo_recur.m similarity index 100% rename from src/VBA/subfunctions/demo_recur.m rename to src/ext/VBA/subfunctions/demo_recur.m diff --git a/src/VBA/subfunctions/demo_redundancy.m b/src/ext/VBA/subfunctions/demo_redundancy.m similarity index 100% rename from src/VBA/subfunctions/demo_redundancy.m rename to src/ext/VBA/subfunctions/demo_redundancy.m diff --git a/src/VBA/subfunctions/demo_sparsePriors.m b/src/ext/VBA/subfunctions/demo_sparsePriors.m similarity index 100% rename from src/VBA/subfunctions/demo_sparsePriors.m rename to src/ext/VBA/subfunctions/demo_sparsePriors.m diff --git a/src/VBA/subfunctions/demo_spm_hrf.m b/src/ext/VBA/subfunctions/demo_spm_hrf.m similarity index 100% rename from src/VBA/subfunctions/demo_spm_hrf.m rename to src/ext/VBA/subfunctions/demo_spm_hrf.m diff --git a/src/VBA/subfunctions/demo_stability_HRF.m b/src/ext/VBA/subfunctions/demo_stability_HRF.m similarity index 100% rename from src/VBA/subfunctions/demo_stability_HRF.m rename to src/ext/VBA/subfunctions/demo_stability_HRF.m diff --git a/src/VBA/subfunctions/demo_stochasticBinomial.m b/src/ext/VBA/subfunctions/demo_stochasticBinomial.m similarity index 100% rename from src/VBA/subfunctions/demo_stochasticBinomial.m rename to src/ext/VBA/subfunctions/demo_stochasticBinomial.m diff --git a/src/VBA/subfunctions/demo_susceptibility.m b/src/ext/VBA/subfunctions/demo_susceptibility.m similarity index 100% rename from src/VBA/subfunctions/demo_susceptibility.m rename to src/ext/VBA/subfunctions/demo_susceptibility.m diff --git a/src/VBA/subfunctions/demo_test.m b/src/ext/VBA/subfunctions/demo_test.m similarity index 100% rename from src/VBA/subfunctions/demo_test.m rename to src/ext/VBA/subfunctions/demo_test.m diff --git a/src/VBA/subfunctions/demo_trainTest.m b/src/ext/VBA/subfunctions/demo_trainTest.m similarity index 100% rename from src/VBA/subfunctions/demo_trainTest.m rename to src/ext/VBA/subfunctions/demo_trainTest.m diff --git a/src/VBA/subfunctions/demo_volatileVB.m b/src/ext/VBA/subfunctions/demo_volatileVB.m similarity index 100% rename from src/VBA/subfunctions/demo_volatileVB.m rename to src/ext/VBA/subfunctions/demo_volatileVB.m diff --git a/src/VBA/subfunctions/demo_wsls.m b/src/ext/VBA/subfunctions/demo_wsls.m similarity index 100% rename from src/VBA/subfunctions/demo_wsls.m rename to src/ext/VBA/subfunctions/demo_wsls.m diff --git a/src/VBA/subfunctions/displayResults.m b/src/ext/VBA/subfunctions/displayResults.m similarity index 100% rename from src/VBA/subfunctions/displayResults.m rename to src/ext/VBA/subfunctions/displayResults.m diff --git a/src/VBA/subfunctions/displaySimulations.m b/src/ext/VBA/subfunctions/displaySimulations.m similarity index 100% rename from src/VBA/subfunctions/displaySimulations.m rename to src/ext/VBA/subfunctions/displaySimulations.m diff --git a/src/VBA/subfunctions/dsdv.m b/src/ext/VBA/subfunctions/dsdv.m similarity index 100% rename from src/VBA/subfunctions/dsdv.m rename to src/ext/VBA/subfunctions/dsdv.m diff --git a/src/VBA/subfunctions/elvis.m b/src/ext/VBA/subfunctions/elvis.m similarity index 100% rename from src/VBA/subfunctions/elvis.m rename to src/ext/VBA/subfunctions/elvis.m diff --git a/src/VBA/subfunctions/evolution0bisND.m b/src/ext/VBA/subfunctions/evolution0bisND.m similarity index 100% rename from src/VBA/subfunctions/evolution0bisND.m rename to src/ext/VBA/subfunctions/evolution0bisND.m diff --git a/src/VBA/subfunctions/expBinom.m b/src/ext/VBA/subfunctions/expBinom.m similarity index 100% rename from src/VBA/subfunctions/expBinom.m rename to src/ext/VBA/subfunctions/expBinom.m diff --git a/src/VBA/subfunctions/extend_dcm.m b/src/ext/VBA/subfunctions/extend_dcm.m similarity index 100% rename from src/VBA/subfunctions/extend_dcm.m rename to src/ext/VBA/subfunctions/extend_dcm.m diff --git a/src/VBA/subfunctions/extractFIR.m b/src/ext/VBA/subfunctions/extractFIR.m similarity index 100% rename from src/VBA/subfunctions/extractFIR.m rename to src/ext/VBA/subfunctions/extractFIR.m diff --git a/src/VBA/subfunctions/extractKernels.m b/src/ext/VBA/subfunctions/extractKernels.m similarity index 100% rename from src/VBA/subfunctions/extractKernels.m rename to src/ext/VBA/subfunctions/extractKernels.m diff --git a/src/VBA/subfunctions/f_2DneuralField.m b/src/ext/VBA/subfunctions/f_2DneuralField.m similarity index 100% rename from src/VBA/subfunctions/f_2DneuralField.m rename to src/ext/VBA/subfunctions/f_2DneuralField.m diff --git a/src/VBA/subfunctions/f_2d.m b/src/ext/VBA/subfunctions/f_2d.m similarity index 100% rename from src/VBA/subfunctions/f_2d.m rename to src/ext/VBA/subfunctions/f_2d.m diff --git a/src/VBA/subfunctions/f_2dwu.m b/src/ext/VBA/subfunctions/f_2dwu.m similarity index 100% rename from src/VBA/subfunctions/f_2dwu.m rename to src/ext/VBA/subfunctions/f_2dwu.m diff --git a/src/VBA/subfunctions/f_AR.m b/src/ext/VBA/subfunctions/f_AR.m similarity index 100% rename from src/VBA/subfunctions/f_AR.m rename to src/ext/VBA/subfunctions/f_AR.m diff --git a/src/VBA/subfunctions/f_ARn.m b/src/ext/VBA/subfunctions/f_ARn.m similarity index 100% rename from src/VBA/subfunctions/f_ARn.m rename to src/ext/VBA/subfunctions/f_ARn.m diff --git a/src/VBA/subfunctions/f_ARplus.m b/src/ext/VBA/subfunctions/f_ARplus.m similarity index 100% rename from src/VBA/subfunctions/f_ARplus.m rename to src/ext/VBA/subfunctions/f_ARplus.m diff --git a/src/VBA/subfunctions/f_AVL.m b/src/ext/VBA/subfunctions/f_AVL.m similarity index 100% rename from src/VBA/subfunctions/f_AVL.m rename to src/ext/VBA/subfunctions/f_AVL.m diff --git a/src/VBA/subfunctions/f_CaBBI_FHN.m b/src/ext/VBA/subfunctions/f_CaBBI_FHN.m similarity index 100% rename from src/VBA/subfunctions/f_CaBBI_FHN.m rename to src/ext/VBA/subfunctions/f_CaBBI_FHN.m diff --git a/src/VBA/subfunctions/f_CaBBI_QGIF.m b/src/ext/VBA/subfunctions/f_CaBBI_QGIF.m similarity index 100% rename from src/VBA/subfunctions/f_CaBBI_QGIF.m rename to src/ext/VBA/subfunctions/f_CaBBI_QGIF.m diff --git a/src/VBA/subfunctions/f_DCMwHRF.m b/src/ext/VBA/subfunctions/f_DCMwHRF.m similarity index 100% rename from src/VBA/subfunctions/f_DCMwHRF.m rename to src/ext/VBA/subfunctions/f_DCMwHRF.m diff --git a/src/VBA/subfunctions/f_DCMwHRFext.m b/src/ext/VBA/subfunctions/f_DCMwHRFext.m similarity index 100% rename from src/VBA/subfunctions/f_DCMwHRFext.m rename to src/ext/VBA/subfunctions/f_DCMwHRFext.m diff --git a/src/VBA/subfunctions/f_FitzHughNagumo.m b/src/ext/VBA/subfunctions/f_FitzHughNagumo.m similarity index 100% rename from src/VBA/subfunctions/f_FitzHughNagumo.m rename to src/ext/VBA/subfunctions/f_FitzHughNagumo.m diff --git a/src/VBA/subfunctions/f_FitzHughNagumo_calcium.m b/src/ext/VBA/subfunctions/f_FitzHughNagumo_calcium.m similarity index 100% rename from src/VBA/subfunctions/f_FitzHughNagumo_calcium.m rename to src/ext/VBA/subfunctions/f_FitzHughNagumo_calcium.m diff --git a/src/VBA/subfunctions/f_HH.m b/src/ext/VBA/subfunctions/f_HH.m similarity index 100% rename from src/VBA/subfunctions/f_HH.m rename to src/ext/VBA/subfunctions/f_HH.m diff --git a/src/VBA/subfunctions/f_HRF.m b/src/ext/VBA/subfunctions/f_HRF.m similarity index 100% rename from src/VBA/subfunctions/f_HRF.m rename to src/ext/VBA/subfunctions/f_HRF.m diff --git a/src/VBA/subfunctions/f_HRF2.m b/src/ext/VBA/subfunctions/f_HRF2.m similarity index 100% rename from src/VBA/subfunctions/f_HRF2.m rename to src/ext/VBA/subfunctions/f_HRF2.m diff --git a/src/VBA/subfunctions/f_HRF3.m b/src/ext/VBA/subfunctions/f_HRF3.m similarity index 100% rename from src/VBA/subfunctions/f_HRF3.m rename to src/ext/VBA/subfunctions/f_HRF3.m diff --git a/src/VBA/subfunctions/f_Henon.m b/src/ext/VBA/subfunctions/f_Henon.m similarity index 100% rename from src/VBA/subfunctions/f_Henon.m rename to src/ext/VBA/subfunctions/f_Henon.m diff --git a/src/VBA/subfunctions/f_L1.m b/src/ext/VBA/subfunctions/f_L1.m similarity index 100% rename from src/VBA/subfunctions/f_L1.m rename to src/ext/VBA/subfunctions/f_L1.m diff --git a/src/VBA/subfunctions/f_LV2D.m b/src/ext/VBA/subfunctions/f_LV2D.m similarity index 100% rename from src/VBA/subfunctions/f_LV2D.m rename to src/ext/VBA/subfunctions/f_LV2D.m diff --git a/src/VBA/subfunctions/f_Lorenz.m b/src/ext/VBA/subfunctions/f_Lorenz.m similarity index 100% rename from src/VBA/subfunctions/f_Lorenz.m rename to src/ext/VBA/subfunctions/f_Lorenz.m diff --git a/src/VBA/subfunctions/f_LotkaVolterra.m b/src/ext/VBA/subfunctions/f_LotkaVolterra.m similarity index 100% rename from src/VBA/subfunctions/f_LotkaVolterra.m rename to src/ext/VBA/subfunctions/f_LotkaVolterra.m diff --git a/src/VBA/subfunctions/f_OpLearn.m b/src/ext/VBA/subfunctions/f_OpLearn.m similarity index 100% rename from src/VBA/subfunctions/f_OpLearn.m rename to src/ext/VBA/subfunctions/f_OpLearn.m diff --git a/src/VBA/subfunctions/f_PSP.m b/src/ext/VBA/subfunctions/f_PSP.m similarity index 100% rename from src/VBA/subfunctions/f_PSP.m rename to src/ext/VBA/subfunctions/f_PSP.m diff --git a/src/VBA/subfunctions/f_Qlearn.m b/src/ext/VBA/subfunctions/f_Qlearn.m similarity index 100% rename from src/VBA/subfunctions/f_Qlearn.m rename to src/ext/VBA/subfunctions/f_Qlearn.m diff --git a/src/VBA/subfunctions/f_Qlearn2.m b/src/ext/VBA/subfunctions/f_Qlearn2.m similarity index 100% rename from src/VBA/subfunctions/f_Qlearn2.m rename to src/ext/VBA/subfunctions/f_Qlearn2.m diff --git a/src/VBA/subfunctions/f_Qlearn_dynLR.m b/src/ext/VBA/subfunctions/f_Qlearn_dynLR.m similarity index 100% rename from src/VBA/subfunctions/f_Qlearn_dynLR.m rename to src/ext/VBA/subfunctions/f_Qlearn_dynLR.m diff --git a/src/VBA/subfunctions/f_Qlearn_gammaLR.m b/src/ext/VBA/subfunctions/f_Qlearn_gammaLR.m similarity index 100% rename from src/VBA/subfunctions/f_Qlearn_gammaLR.m rename to src/ext/VBA/subfunctions/f_Qlearn_gammaLR.m diff --git a/src/VBA/subfunctions/f_Rossler.m b/src/ext/VBA/subfunctions/f_Rossler.m similarity index 100% rename from src/VBA/subfunctions/f_Rossler.m rename to src/ext/VBA/subfunctions/f_Rossler.m diff --git a/src/VBA/subfunctions/f_SHC.m b/src/ext/VBA/subfunctions/f_SHC.m similarity index 100% rename from src/VBA/subfunctions/f_SHC.m rename to src/ext/VBA/subfunctions/f_SHC.m diff --git a/src/VBA/subfunctions/f_VBfree.m b/src/ext/VBA/subfunctions/f_VBfree.m similarity index 100% rename from src/VBA/subfunctions/f_VBfree.m rename to src/ext/VBA/subfunctions/f_VBfree.m diff --git a/src/VBA/subfunctions/f_VBvolatile0.m b/src/ext/VBA/subfunctions/f_VBvolatile0.m similarity index 100% rename from src/VBA/subfunctions/f_VBvolatile0.m rename to src/ext/VBA/subfunctions/f_VBvolatile0.m diff --git a/src/VBA/subfunctions/f_alpha.m b/src/ext/VBA/subfunctions/f_alpha.m similarity index 100% rename from src/VBA/subfunctions/f_alpha.m rename to src/ext/VBA/subfunctions/f_alpha.m diff --git a/src/VBA/subfunctions/f_dbw.m b/src/ext/VBA/subfunctions/f_dbw.m similarity index 100% rename from src/VBA/subfunctions/f_dbw.m rename to src/ext/VBA/subfunctions/f_dbw.m diff --git a/src/VBA/subfunctions/f_dcm4fmri.m b/src/ext/VBA/subfunctions/f_dcm4fmri.m similarity index 100% rename from src/VBA/subfunctions/f_dcm4fmri.m rename to src/ext/VBA/subfunctions/f_dcm4fmri.m diff --git a/src/VBA/subfunctions/f_dcm4fmri0.m b/src/ext/VBA/subfunctions/f_dcm4fmri0.m similarity index 100% rename from src/VBA/subfunctions/f_dcm4fmri0.m rename to src/ext/VBA/subfunctions/f_dcm4fmri0.m diff --git a/src/VBA/subfunctions/f_dcm_extension.m b/src/ext/VBA/subfunctions/f_dcm_extension.m similarity index 100% rename from src/VBA/subfunctions/f_dcm_extension.m rename to src/ext/VBA/subfunctions/f_dcm_extension.m diff --git a/src/VBA/subfunctions/f_dcm_withU.m b/src/ext/VBA/subfunctions/f_dcm_withU.m similarity index 100% rename from src/VBA/subfunctions/f_dcm_withU.m rename to src/ext/VBA/subfunctions/f_dcm_withU.m diff --git a/src/VBA/subfunctions/f_doubleWell.m b/src/ext/VBA/subfunctions/f_doubleWell.m similarity index 100% rename from src/VBA/subfunctions/f_doubleWell.m rename to src/ext/VBA/subfunctions/f_doubleWell.m diff --git a/src/VBA/subfunctions/f_embed0.m b/src/ext/VBA/subfunctions/f_embed0.m similarity index 100% rename from src/VBA/subfunctions/f_embed0.m rename to src/ext/VBA/subfunctions/f_embed0.m diff --git a/src/VBA/subfunctions/f_embedAR.m b/src/ext/VBA/subfunctions/f_embedAR.m similarity index 100% rename from src/VBA/subfunctions/f_embedAR.m rename to src/ext/VBA/subfunctions/f_embedAR.m diff --git a/src/VBA/subfunctions/f_embed_old.m b/src/ext/VBA/subfunctions/f_embed_old.m similarity index 100% rename from src/VBA/subfunctions/f_embed_old.m rename to src/ext/VBA/subfunctions/f_embed_old.m diff --git a/src/VBA/subfunctions/f_fullDCM4fmri.m b/src/ext/VBA/subfunctions/f_fullDCM4fmri.m similarity index 100% rename from src/VBA/subfunctions/f_fullDCM4fmri.m rename to src/ext/VBA/subfunctions/f_fullDCM4fmri.m diff --git a/src/VBA/subfunctions/f_gen.m b/src/ext/VBA/subfunctions/f_gen.m similarity index 100% rename from src/VBA/subfunctions/f_gen.m rename to src/ext/VBA/subfunctions/f_gen.m diff --git a/src/VBA/subfunctions/f_lin1D.m b/src/ext/VBA/subfunctions/f_lin1D.m similarity index 100% rename from src/VBA/subfunctions/f_lin1D.m rename to src/ext/VBA/subfunctions/f_lin1D.m diff --git a/src/VBA/subfunctions/f_lin2D.m b/src/ext/VBA/subfunctions/f_lin2D.m similarity index 100% rename from src/VBA/subfunctions/f_lin2D.m rename to src/ext/VBA/subfunctions/f_lin2D.m diff --git a/src/VBA/subfunctions/f_replicator.m b/src/ext/VBA/subfunctions/f_replicator.m similarity index 100% rename from src/VBA/subfunctions/f_replicator.m rename to src/ext/VBA/subfunctions/f_replicator.m diff --git a/src/VBA/subfunctions/f_rwl.m b/src/ext/VBA/subfunctions/f_rwl.m similarity index 100% rename from src/VBA/subfunctions/f_rwl.m rename to src/ext/VBA/subfunctions/f_rwl.m diff --git a/src/VBA/subfunctions/f_rwl2.m b/src/ext/VBA/subfunctions/f_rwl2.m similarity index 100% rename from src/VBA/subfunctions/f_rwl2.m rename to src/ext/VBA/subfunctions/f_rwl2.m diff --git a/src/VBA/subfunctions/f_try.m b/src/ext/VBA/subfunctions/f_try.m similarity index 100% rename from src/VBA/subfunctions/f_try.m rename to src/ext/VBA/subfunctions/f_try.m diff --git a/src/VBA/subfunctions/f_vanDerPol.m b/src/ext/VBA/subfunctions/f_vanDerPol.m similarity index 100% rename from src/VBA/subfunctions/f_vanDerPol.m rename to src/ext/VBA/subfunctions/f_vanDerPol.m diff --git a/src/VBA/subfunctions/f_vgo.m b/src/ext/VBA/subfunctions/f_vgo.m similarity index 100% rename from src/VBA/subfunctions/f_vgo.m rename to src/ext/VBA/subfunctions/f_vgo.m diff --git a/src/VBA/subfunctions/f_wsls.m b/src/ext/VBA/subfunctions/f_wsls.m similarity index 100% rename from src/VBA/subfunctions/f_wsls.m rename to src/ext/VBA/subfunctions/f_wsls.m diff --git a/src/VBA/subfunctions/findCI.m b/src/ext/VBA/subfunctions/findCI.m similarity index 100% rename from src/VBA/subfunctions/findCI.m rename to src/ext/VBA/subfunctions/findCI.m diff --git a/src/VBA/subfunctions/g_2AFC_basis.m b/src/ext/VBA/subfunctions/g_2AFC_basis.m similarity index 100% rename from src/VBA/subfunctions/g_2AFC_basis.m rename to src/ext/VBA/subfunctions/g_2AFC_basis.m diff --git a/src/VBA/subfunctions/g_AVL.m b/src/ext/VBA/subfunctions/g_AVL.m similarity index 100% rename from src/VBA/subfunctions/g_AVL.m rename to src/ext/VBA/subfunctions/g_AVL.m diff --git a/src/VBA/subfunctions/g_CaBBI.m b/src/ext/VBA/subfunctions/g_CaBBI.m similarity index 100% rename from src/VBA/subfunctions/g_CaBBI.m rename to src/ext/VBA/subfunctions/g_CaBBI.m diff --git a/src/VBA/subfunctions/g_DCMwHRFext.m b/src/ext/VBA/subfunctions/g_DCMwHRFext.m similarity index 100% rename from src/VBA/subfunctions/g_DCMwHRFext.m rename to src/ext/VBA/subfunctions/g_DCMwHRFext.m diff --git a/src/VBA/subfunctions/g_DG2.m b/src/ext/VBA/subfunctions/g_DG2.m similarity index 100% rename from src/VBA/subfunctions/g_DG2.m rename to src/ext/VBA/subfunctions/g_DG2.m diff --git a/src/VBA/subfunctions/g_DoubleGamma.m b/src/ext/VBA/subfunctions/g_DoubleGamma.m similarity index 100% rename from src/VBA/subfunctions/g_DoubleGamma.m rename to src/ext/VBA/subfunctions/g_DoubleGamma.m diff --git a/src/VBA/subfunctions/g_ERP.m b/src/ext/VBA/subfunctions/g_ERP.m similarity index 100% rename from src/VBA/subfunctions/g_ERP.m rename to src/ext/VBA/subfunctions/g_ERP.m diff --git a/src/VBA/subfunctions/g_ERP_reduced.m b/src/ext/VBA/subfunctions/g_ERP_reduced.m similarity index 100% rename from src/VBA/subfunctions/g_ERP_reduced.m rename to src/ext/VBA/subfunctions/g_ERP_reduced.m diff --git a/src/VBA/subfunctions/g_ExpUtil.m b/src/ext/VBA/subfunctions/g_ExpUtil.m similarity index 100% rename from src/VBA/subfunctions/g_ExpUtil.m rename to src/ext/VBA/subfunctions/g_ExpUtil.m diff --git a/src/VBA/subfunctions/g_Fourier.m b/src/ext/VBA/subfunctions/g_Fourier.m similarity index 100% rename from src/VBA/subfunctions/g_Fourier.m rename to src/ext/VBA/subfunctions/g_Fourier.m diff --git a/src/VBA/subfunctions/g_GLM.m b/src/ext/VBA/subfunctions/g_GLM.m similarity index 100% rename from src/VBA/subfunctions/g_GLM.m rename to src/ext/VBA/subfunctions/g_GLM.m diff --git a/src/VBA/subfunctions/g_GLMsparse.m b/src/ext/VBA/subfunctions/g_GLMsparse.m similarity index 100% rename from src/VBA/subfunctions/g_GLMsparse.m rename to src/ext/VBA/subfunctions/g_GLMsparse.m diff --git a/src/VBA/subfunctions/g_GammaDensity.m b/src/ext/VBA/subfunctions/g_GammaDensity.m similarity index 100% rename from src/VBA/subfunctions/g_GammaDensity.m rename to src/ext/VBA/subfunctions/g_GammaDensity.m diff --git a/src/VBA/subfunctions/g_Gaussian.m b/src/ext/VBA/subfunctions/g_Gaussian.m similarity index 100% rename from src/VBA/subfunctions/g_Gaussian.m rename to src/ext/VBA/subfunctions/g_Gaussian.m diff --git a/src/VBA/subfunctions/g_HRF3.m b/src/ext/VBA/subfunctions/g_HRF3.m similarity index 100% rename from src/VBA/subfunctions/g_HRF3.m rename to src/ext/VBA/subfunctions/g_HRF3.m diff --git a/src/VBA/subfunctions/g_HRF_distributed.m b/src/ext/VBA/subfunctions/g_HRF_distributed.m similarity index 100% rename from src/VBA/subfunctions/g_HRF_distributed.m rename to src/ext/VBA/subfunctions/g_HRF_distributed.m diff --git a/src/VBA/subfunctions/g_Id.m b/src/ext/VBA/subfunctions/g_Id.m similarity index 100% rename from src/VBA/subfunctions/g_Id.m rename to src/ext/VBA/subfunctions/g_Id.m diff --git a/src/VBA/subfunctions/g_Id_phi.m b/src/ext/VBA/subfunctions/g_Id_phi.m similarity index 100% rename from src/VBA/subfunctions/g_Id_phi.m rename to src/ext/VBA/subfunctions/g_Id_phi.m diff --git a/src/VBA/subfunctions/g_NI.m b/src/ext/VBA/subfunctions/g_NI.m similarity index 100% rename from src/VBA/subfunctions/g_NI.m rename to src/ext/VBA/subfunctions/g_NI.m diff --git a/src/VBA/subfunctions/g_RFX.m b/src/ext/VBA/subfunctions/g_RFX.m similarity index 100% rename from src/VBA/subfunctions/g_RFX.m rename to src/ext/VBA/subfunctions/g_RFX.m diff --git a/src/VBA/subfunctions/g_Udummy.m b/src/ext/VBA/subfunctions/g_Udummy.m similarity index 100% rename from src/VBA/subfunctions/g_Udummy.m rename to src/ext/VBA/subfunctions/g_Udummy.m diff --git a/src/VBA/subfunctions/g_VBvolatile0.m b/src/ext/VBA/subfunctions/g_VBvolatile0.m similarity index 100% rename from src/VBA/subfunctions/g_VBvolatile0.m rename to src/ext/VBA/subfunctions/g_VBvolatile0.m diff --git a/src/VBA/subfunctions/g_classif.m b/src/ext/VBA/subfunctions/g_classif.m similarity index 100% rename from src/VBA/subfunctions/g_classif.m rename to src/ext/VBA/subfunctions/g_classif.m diff --git a/src/VBA/subfunctions/g_convSig_approx.m b/src/ext/VBA/subfunctions/g_convSig_approx.m similarity index 100% rename from src/VBA/subfunctions/g_convSig_approx.m rename to src/ext/VBA/subfunctions/g_convSig_approx.m diff --git a/src/VBA/subfunctions/g_conv_approx.m b/src/ext/VBA/subfunctions/g_conv_approx.m similarity index 100% rename from src/VBA/subfunctions/g_conv_approx.m rename to src/ext/VBA/subfunctions/g_conv_approx.m diff --git a/src/VBA/subfunctions/g_demo_extended.m b/src/ext/VBA/subfunctions/g_demo_extended.m similarity index 100% rename from src/VBA/subfunctions/g_demo_extended.m rename to src/ext/VBA/subfunctions/g_demo_extended.m diff --git a/src/VBA/subfunctions/g_demo_susceptibility.m b/src/ext/VBA/subfunctions/g_demo_susceptibility.m similarity index 100% rename from src/VBA/subfunctions/g_demo_susceptibility.m rename to src/ext/VBA/subfunctions/g_demo_susceptibility.m diff --git a/src/VBA/subfunctions/g_discounting.m b/src/ext/VBA/subfunctions/g_discounting.m similarity index 100% rename from src/VBA/subfunctions/g_discounting.m rename to src/ext/VBA/subfunctions/g_discounting.m diff --git a/src/VBA/subfunctions/g_dummy.m b/src/ext/VBA/subfunctions/g_dummy.m similarity index 100% rename from src/VBA/subfunctions/g_dummy.m rename to src/ext/VBA/subfunctions/g_dummy.m diff --git a/src/VBA/subfunctions/g_embedAR.m b/src/ext/VBA/subfunctions/g_embedAR.m similarity index 100% rename from src/VBA/subfunctions/g_embedAR.m rename to src/ext/VBA/subfunctions/g_embedAR.m diff --git a/src/VBA/subfunctions/g_exp.m b/src/ext/VBA/subfunctions/g_exp.m similarity index 100% rename from src/VBA/subfunctions/g_exp.m rename to src/ext/VBA/subfunctions/g_exp.m diff --git a/src/VBA/subfunctions/g_exp2d.m b/src/ext/VBA/subfunctions/g_exp2d.m similarity index 100% rename from src/VBA/subfunctions/g_exp2d.m rename to src/ext/VBA/subfunctions/g_exp2d.m diff --git a/src/VBA/subfunctions/g_fullDCM4fmri.m b/src/ext/VBA/subfunctions/g_fullDCM4fmri.m similarity index 100% rename from src/VBA/subfunctions/g_fullDCM4fmri.m rename to src/ext/VBA/subfunctions/g_fullDCM4fmri.m diff --git a/src/VBA/subfunctions/g_goNogo.m b/src/ext/VBA/subfunctions/g_goNogo.m similarity index 100% rename from src/VBA/subfunctions/g_goNogo.m rename to src/ext/VBA/subfunctions/g_goNogo.m diff --git a/src/VBA/subfunctions/g_ip.m b/src/ext/VBA/subfunctions/g_ip.m similarity index 100% rename from src/VBA/subfunctions/g_ip.m rename to src/ext/VBA/subfunctions/g_ip.m diff --git a/src/VBA/subfunctions/g_logistic.m b/src/ext/VBA/subfunctions/g_logistic.m similarity index 100% rename from src/VBA/subfunctions/g_logistic.m rename to src/ext/VBA/subfunctions/g_logistic.m diff --git a/src/VBA/subfunctions/g_matmap.m b/src/ext/VBA/subfunctions/g_matmap.m similarity index 100% rename from src/VBA/subfunctions/g_matmap.m rename to src/ext/VBA/subfunctions/g_matmap.m diff --git a/src/VBA/subfunctions/g_mixU.m b/src/ext/VBA/subfunctions/g_mixU.m similarity index 100% rename from src/VBA/subfunctions/g_mixU.m rename to src/ext/VBA/subfunctions/g_mixU.m diff --git a/src/VBA/subfunctions/g_nl0.m b/src/ext/VBA/subfunctions/g_nl0.m similarity index 100% rename from src/VBA/subfunctions/g_nl0.m rename to src/ext/VBA/subfunctions/g_nl0.m diff --git a/src/VBA/subfunctions/g_odds.m b/src/ext/VBA/subfunctions/g_odds.m similarity index 100% rename from src/VBA/subfunctions/g_odds.m rename to src/ext/VBA/subfunctions/g_odds.m diff --git a/src/VBA/subfunctions/g_odds2.m b/src/ext/VBA/subfunctions/g_odds2.m similarity index 100% rename from src/VBA/subfunctions/g_odds2.m rename to src/ext/VBA/subfunctions/g_odds2.m diff --git a/src/VBA/subfunctions/g_probit.m b/src/ext/VBA/subfunctions/g_probit.m similarity index 100% rename from src/VBA/subfunctions/g_probit.m rename to src/ext/VBA/subfunctions/g_probit.m diff --git a/src/VBA/subfunctions/g_rbf.m b/src/ext/VBA/subfunctions/g_rbf.m similarity index 100% rename from src/VBA/subfunctions/g_rbf.m rename to src/ext/VBA/subfunctions/g_rbf.m diff --git a/src/VBA/subfunctions/g_rigid2D.m b/src/ext/VBA/subfunctions/g_rigid2D.m similarity index 100% rename from src/VBA/subfunctions/g_rigid2D.m rename to src/ext/VBA/subfunctions/g_rigid2D.m diff --git a/src/VBA/subfunctions/g_sig_u.m b/src/ext/VBA/subfunctions/g_sig_u.m similarity index 100% rename from src/VBA/subfunctions/g_sig_u.m rename to src/ext/VBA/subfunctions/g_sig_u.m diff --git a/src/VBA/subfunctions/g_sigm.m b/src/ext/VBA/subfunctions/g_sigm.m similarity index 100% rename from src/VBA/subfunctions/g_sigm.m rename to src/ext/VBA/subfunctions/g_sigm.m diff --git a/src/VBA/subfunctions/g_sigm_binomial.m b/src/ext/VBA/subfunctions/g_sigm_binomial.m similarity index 100% rename from src/VBA/subfunctions/g_sigm_binomial.m rename to src/ext/VBA/subfunctions/g_sigm_binomial.m diff --git a/src/VBA/subfunctions/g_sigmoid.m b/src/ext/VBA/subfunctions/g_sigmoid.m similarity index 100% rename from src/VBA/subfunctions/g_sigmoid.m rename to src/ext/VBA/subfunctions/g_sigmoid.m diff --git a/src/VBA/subfunctions/g_softmax.m b/src/ext/VBA/subfunctions/g_softmax.m similarity index 100% rename from src/VBA/subfunctions/g_softmax.m rename to src/ext/VBA/subfunctions/g_softmax.m diff --git a/src/VBA/subfunctions/g_softmax4decoding.m b/src/ext/VBA/subfunctions/g_softmax4decoding.m similarity index 100% rename from src/VBA/subfunctions/g_softmax4decoding.m rename to src/ext/VBA/subfunctions/g_softmax4decoding.m diff --git a/src/VBA/subfunctions/g_sqrtSig.m b/src/ext/VBA/subfunctions/g_sqrtSig.m similarity index 100% rename from src/VBA/subfunctions/g_sqrtSig.m rename to src/ext/VBA/subfunctions/g_sqrtSig.m diff --git a/src/VBA/subfunctions/g_u2c.m b/src/ext/VBA/subfunctions/g_u2c.m similarity index 100% rename from src/VBA/subfunctions/g_u2c.m rename to src/ext/VBA/subfunctions/g_u2c.m diff --git a/src/VBA/subfunctions/g_u2p.m b/src/ext/VBA/subfunctions/g_u2p.m similarity index 100% rename from src/VBA/subfunctions/g_u2p.m rename to src/ext/VBA/subfunctions/g_u2p.m diff --git a/src/VBA/subfunctions/g_vgo.m b/src/ext/VBA/subfunctions/g_vgo.m similarity index 100% rename from src/VBA/subfunctions/g_vgo.m rename to src/ext/VBA/subfunctions/g_vgo.m diff --git a/src/VBA/subfunctions/getFamily.m b/src/ext/VBA/subfunctions/getFamily.m similarity index 100% rename from src/VBA/subfunctions/getFamily.m rename to src/ext/VBA/subfunctions/getFamily.m diff --git a/src/VBA/subfunctions/getGitInfo.m b/src/ext/VBA/subfunctions/getGitInfo.m similarity index 100% rename from src/VBA/subfunctions/getGitInfo.m rename to src/ext/VBA/subfunctions/getGitInfo.m diff --git a/src/VBA/subfunctions/getOptions4dcm.m b/src/ext/VBA/subfunctions/getOptions4dcm.m similarity index 100% rename from src/VBA/subfunctions/getOptions4dcm.m rename to src/ext/VBA/subfunctions/getOptions4dcm.m diff --git a/src/VBA/subfunctions/getPosteriorfromOTO.m b/src/ext/VBA/subfunctions/getPosteriorfromOTO.m similarity index 100% rename from src/VBA/subfunctions/getPosteriorfromOTO.m rename to src/ext/VBA/subfunctions/getPosteriorfromOTO.m diff --git a/src/VBA/subfunctions/getPriors.m b/src/ext/VBA/subfunctions/getPriors.m similarity index 100% rename from src/VBA/subfunctions/getPriors.m rename to src/ext/VBA/subfunctions/getPriors.m diff --git a/src/VBA/subfunctions/get_ARcov.m b/src/ext/VBA/subfunctions/get_ARcov.m similarity index 100% rename from src/VBA/subfunctions/get_ARcov.m rename to src/ext/VBA/subfunctions/get_ARcov.m diff --git a/src/VBA/subfunctions/get_HRFparams.m b/src/ext/VBA/subfunctions/get_HRFparams.m similarity index 100% rename from src/VBA/subfunctions/get_HRFparams.m rename to src/ext/VBA/subfunctions/get_HRFparams.m diff --git a/src/VBA/subfunctions/get_U_basis.m b/src/ext/VBA/subfunctions/get_U_basis.m similarity index 100% rename from src/VBA/subfunctions/get_U_basis.m rename to src/ext/VBA/subfunctions/get_U_basis.m diff --git a/src/VBA/subfunctions/get_sigmoidMoments.m b/src/ext/VBA/subfunctions/get_sigmoidMoments.m similarity index 100% rename from src/VBA/subfunctions/get_sigmoidMoments.m rename to src/ext/VBA/subfunctions/get_sigmoidMoments.m diff --git a/src/VBA/subfunctions/gridL_binomial.m b/src/ext/VBA/subfunctions/gridL_binomial.m similarity index 100% rename from src/VBA/subfunctions/gridL_binomial.m rename to src/ext/VBA/subfunctions/gridL_binomial.m diff --git a/src/VBA/subfunctions/h_Id.m b/src/ext/VBA/subfunctions/h_Id.m similarity index 100% rename from src/VBA/subfunctions/h_Id.m rename to src/ext/VBA/subfunctions/h_Id.m diff --git a/src/VBA/subfunctions/h_goNogo.m b/src/ext/VBA/subfunctions/h_goNogo.m similarity index 100% rename from src/VBA/subfunctions/h_goNogo.m rename to src/ext/VBA/subfunctions/h_goNogo.m diff --git a/src/VBA/subfunctions/h_randOutcome.m b/src/ext/VBA/subfunctions/h_randOutcome.m similarity index 100% rename from src/VBA/subfunctions/h_randOutcome.m rename to src/ext/VBA/subfunctions/h_randOutcome.m diff --git a/src/VBA/subfunctions/h_truefalse.m b/src/ext/VBA/subfunctions/h_truefalse.m similarity index 100% rename from src/VBA/subfunctions/h_truefalse.m rename to src/ext/VBA/subfunctions/h_truefalse.m diff --git a/src/VBA/subfunctions/h_whichItem.m b/src/ext/VBA/subfunctions/h_whichItem.m similarity index 100% rename from src/VBA/subfunctions/h_whichItem.m rename to src/ext/VBA/subfunctions/h_whichItem.m diff --git a/src/VBA/subfunctions/invsigmoid.m b/src/ext/VBA/subfunctions/invsigmoid.m similarity index 100% rename from src/VBA/subfunctions/invsigmoid.m rename to src/ext/VBA/subfunctions/invsigmoid.m diff --git a/src/VBA/subfunctions/isHrfStable.m b/src/ext/VBA/subfunctions/isHrfStable.m similarity index 100% rename from src/VBA/subfunctions/isHrfStable.m rename to src/ext/VBA/subfunctions/isHrfStable.m diff --git a/src/VBA/subfunctions/iswithin.m b/src/ext/VBA/subfunctions/iswithin.m similarity index 100% rename from src/VBA/subfunctions/iswithin.m rename to src/ext/VBA/subfunctions/iswithin.m diff --git a/src/VBA/subfunctions/kernel_sinexp.m b/src/ext/VBA/subfunctions/kernel_sinexp.m similarity index 100% rename from src/VBA/subfunctions/kernel_sinexp.m rename to src/ext/VBA/subfunctions/kernel_sinexp.m diff --git a/src/VBA/subfunctions/logExp.m b/src/ext/VBA/subfunctions/logExp.m similarity index 100% rename from src/VBA/subfunctions/logExp.m rename to src/ext/VBA/subfunctions/logExp.m diff --git a/src/VBA/subfunctions/medianfilter0.m b/src/ext/VBA/subfunctions/medianfilter0.m similarity index 100% rename from src/VBA/subfunctions/medianfilter0.m rename to src/ext/VBA/subfunctions/medianfilter0.m diff --git a/src/VBA/subfunctions/multi2num.m b/src/ext/VBA/subfunctions/multi2num.m similarity index 100% rename from src/VBA/subfunctions/multi2num.m rename to src/ext/VBA/subfunctions/multi2num.m diff --git a/src/VBA/subfunctions/multinomial_accuracy.m b/src/ext/VBA/subfunctions/multinomial_accuracy.m similarity index 100% rename from src/VBA/subfunctions/multinomial_accuracy.m rename to src/ext/VBA/subfunctions/multinomial_accuracy.m diff --git a/src/VBA/subfunctions/nanfft.m b/src/ext/VBA/subfunctions/nanfft.m similarity index 100% rename from src/VBA/subfunctions/nanfft.m rename to src/ext/VBA/subfunctions/nanfft.m diff --git a/src/VBA/subfunctions/nanzscore.m b/src/ext/VBA/subfunctions/nanzscore.m similarity index 100% rename from src/VBA/subfunctions/nanzscore.m rename to src/ext/VBA/subfunctions/nanzscore.m diff --git a/src/VBA/subfunctions/num2multi.m b/src/ext/VBA/subfunctions/num2multi.m similarity index 100% rename from src/VBA/subfunctions/num2multi.m rename to src/ext/VBA/subfunctions/num2multi.m diff --git a/src/VBA/subfunctions/optimCost.m b/src/ext/VBA/subfunctions/optimCost.m similarity index 100% rename from src/VBA/subfunctions/optimCost.m rename to src/ext/VBA/subfunctions/optimCost.m diff --git a/src/VBA/subfunctions/parseargs.m b/src/ext/VBA/subfunctions/parseargs.m similarity index 100% rename from src/VBA/subfunctions/parseargs.m rename to src/ext/VBA/subfunctions/parseargs.m diff --git a/src/VBA/subfunctions/phi.mat b/src/ext/VBA/subfunctions/phi.mat similarity index 100% rename from src/VBA/subfunctions/phi.mat rename to src/ext/VBA/subfunctions/phi.mat diff --git a/src/VBA/subfunctions/prepare_dcm.m b/src/ext/VBA/subfunctions/prepare_dcm.m similarity index 100% rename from src/VBA/subfunctions/prepare_dcm.m rename to src/ext/VBA/subfunctions/prepare_dcm.m diff --git a/src/VBA/subfunctions/prepare_fullDCM.m b/src/ext/VBA/subfunctions/prepare_fullDCM.m similarity index 100% rename from src/VBA/subfunctions/prepare_fullDCM.m rename to src/ext/VBA/subfunctions/prepare_fullDCM.m diff --git a/src/VBA/subfunctions/priorPrettifyer.m b/src/ext/VBA/subfunctions/priorPrettifyer.m similarity index 100% rename from src/VBA/subfunctions/priorPrettifyer.m rename to src/ext/VBA/subfunctions/priorPrettifyer.m diff --git a/src/VBA/subfunctions/priorUglyfier.m b/src/ext/VBA/subfunctions/priorUglyfier.m similarity index 100% rename from src/VBA/subfunctions/priorUglyfier.m rename to src/ext/VBA/subfunctions/priorUglyfier.m diff --git a/src/VBA/subfunctions/script_test_rec.m b/src/ext/VBA/subfunctions/script_test_rec.m similarity index 100% rename from src/VBA/subfunctions/script_test_rec.m rename to src/ext/VBA/subfunctions/script_test_rec.m diff --git a/src/VBA/subfunctions/sgm.m b/src/ext/VBA/subfunctions/sgm.m similarity index 100% rename from src/VBA/subfunctions/sgm.m rename to src/ext/VBA/subfunctions/sgm.m diff --git a/src/VBA/subfunctions/show_potential.m b/src/ext/VBA/subfunctions/show_potential.m similarity index 100% rename from src/VBA/subfunctions/show_potential.m rename to src/ext/VBA/subfunctions/show_potential.m diff --git a/src/VBA/subfunctions/sig.m b/src/ext/VBA/subfunctions/sig.m similarity index 100% rename from src/VBA/subfunctions/sig.m rename to src/ext/VBA/subfunctions/sig.m diff --git a/src/VBA/subfunctions/sigm.m b/src/ext/VBA/subfunctions/sigm.m similarity index 100% rename from src/VBA/subfunctions/sigm.m rename to src/ext/VBA/subfunctions/sigm.m diff --git a/src/VBA/subfunctions/sigmoid.m b/src/ext/VBA/subfunctions/sigmoid.m similarity index 100% rename from src/VBA/subfunctions/sigmoid.m rename to src/ext/VBA/subfunctions/sigmoid.m diff --git a/src/VBA/subfunctions/sizeXrec.m b/src/ext/VBA/subfunctions/sizeXrec.m similarity index 100% rename from src/VBA/subfunctions/sizeXrec.m rename to src/ext/VBA/subfunctions/sizeXrec.m diff --git a/src/VBA/subfunctions/softmax.m b/src/ext/VBA/subfunctions/softmax.m similarity index 100% rename from src/VBA/subfunctions/softmax.m rename to src/ext/VBA/subfunctions/softmax.m diff --git a/src/VBA/subfunctions/sparseTransform.m b/src/ext/VBA/subfunctions/sparseTransform.m similarity index 100% rename from src/VBA/subfunctions/sparseTransform.m rename to src/ext/VBA/subfunctions/sparseTransform.m diff --git a/src/VBA/subfunctions/spear.m b/src/ext/VBA/subfunctions/spear.m similarity index 100% rename from src/VBA/subfunctions/spear.m rename to src/ext/VBA/subfunctions/spear.m diff --git a/src/VBA/subfunctions/spm_sdcm_estimate.m b/src/ext/VBA/subfunctions/spm_sdcm_estimate.m similarity index 100% rename from src/VBA/subfunctions/spm_sdcm_estimate.m rename to src/ext/VBA/subfunctions/spm_sdcm_estimate.m diff --git a/src/VBA/subfunctions/spm_sdcm_estimate2.m b/src/ext/VBA/subfunctions/spm_sdcm_estimate2.m similarity index 100% rename from src/VBA/subfunctions/spm_sdcm_estimate2.m rename to src/ext/VBA/subfunctions/spm_sdcm_estimate2.m diff --git a/src/VBA/subfunctions/u_Fourier.m b/src/ext/VBA/subfunctions/u_Fourier.m similarity index 100% rename from src/VBA/subfunctions/u_Fourier.m rename to src/ext/VBA/subfunctions/u_Fourier.m diff --git a/src/VBA/subfunctions/u_FourierComplete.m b/src/ext/VBA/subfunctions/u_FourierComplete.m similarity index 100% rename from src/VBA/subfunctions/u_FourierComplete.m rename to src/ext/VBA/subfunctions/u_FourierComplete.m diff --git a/src/VBA/subfunctions/u_GaussianBumps.m b/src/ext/VBA/subfunctions/u_GaussianBumps.m similarity index 100% rename from src/VBA/subfunctions/u_GaussianBumps.m rename to src/ext/VBA/subfunctions/u_GaussianBumps.m diff --git a/src/VBA/subfunctions/u_RBF.m b/src/ext/VBA/subfunctions/u_RBF.m similarity index 100% rename from src/VBA/subfunctions/u_RBF.m rename to src/ext/VBA/subfunctions/u_RBF.m diff --git a/src/VBA/subfunctions/unwrapVBvolatileOTO.m b/src/ext/VBA/subfunctions/unwrapVBvolatileOTO.m similarity index 100% rename from src/VBA/subfunctions/unwrapVBvolatileOTO.m rename to src/ext/VBA/subfunctions/unwrapVBvolatileOTO.m diff --git a/src/VBA/subfunctions/util.m b/src/ext/VBA/subfunctions/util.m similarity index 100% rename from src/VBA/subfunctions/util.m rename to src/ext/VBA/subfunctions/util.m diff --git a/src/VBA/subfunctions/v_discounting.m b/src/ext/VBA/subfunctions/v_discounting.m similarity index 100% rename from src/VBA/subfunctions/v_discounting.m rename to src/ext/VBA/subfunctions/v_discounting.m diff --git a/src/VBA/subfunctions/vba2dcm.m b/src/ext/VBA/subfunctions/vba2dcm.m similarity index 100% rename from src/VBA/subfunctions/vba2dcm.m rename to src/ext/VBA/subfunctions/vba2dcm.m diff --git a/src/VBA/vec.m b/src/ext/VBA/vec.m similarity index 100% rename from src/VBA/vec.m rename to src/ext/VBA/vec.m diff --git a/src/amri_eegfmri/CHANGES_MADE.txt b/src/ext/amri_eegfmri/CHANGES_MADE.txt similarity index 100% rename from src/amri_eegfmri/CHANGES_MADE.txt rename to src/ext/amri_eegfmri/CHANGES_MADE.txt diff --git a/src/amri_eegfmri/LICENSE.txt b/src/ext/amri_eegfmri/LICENSE.txt similarity index 100% rename from src/amri_eegfmri/LICENSE.txt rename to src/ext/amri_eegfmri/LICENSE.txt diff --git a/src/amri_eegfmri/README_1.txt b/src/ext/amri_eegfmri/README_1.txt similarity index 100% rename from src/amri_eegfmri/README_1.txt rename to src/ext/amri_eegfmri/README_1.txt diff --git a/src/amri_eegfmri/README_2.txt b/src/ext/amri_eegfmri/README_2.txt similarity index 100% rename from src/amri_eegfmri/README_2.txt rename to src/ext/amri_eegfmri/README_2.txt diff --git a/src/amri_eegfmri/amri_eeg_rpeak.m b/src/ext/amri_eegfmri/amri_eeg_rpeak.m similarity index 100% rename from src/amri_eegfmri/amri_eeg_rpeak.m rename to src/ext/amri_eegfmri/amri_eeg_rpeak.m diff --git a/src/amri_eegfmri/amri_sig_corr.m b/src/ext/amri_eegfmri/amri_sig_corr.m similarity index 100% rename from src/amri_eegfmri/amri_sig_corr.m rename to src/ext/amri_eegfmri/amri_sig_corr.m diff --git a/src/amri_eegfmri/amri_sig_filtfft.m b/src/ext/amri_eegfmri/amri_sig_filtfft.m similarity index 100% rename from src/amri_eegfmri/amri_sig_filtfft.m rename to src/ext/amri_eegfmri/amri_sig_filtfft.m diff --git a/src/amri_eegfmri/amri_sig_findpeaks.m b/src/ext/amri_eegfmri/amri_sig_findpeaks.m similarity index 100% rename from src/amri_eegfmri/amri_sig_findpeaks.m rename to src/ext/amri_eegfmri/amri_sig_findpeaks.m diff --git a/src/amri_eegfmri/amri_sig_xcorr.m b/src/ext/amri_eegfmri/amri_sig_xcorr.m similarity index 100% rename from src/amri_eegfmri/amri_sig_xcorr.m rename to src/ext/amri_eegfmri/amri_sig_xcorr.m diff --git a/src/amri_eegfmri/amri_stat_outlier.m b/src/ext/amri_eegfmri/amri_stat_outlier.m similarity index 100% rename from src/amri_eegfmri/amri_stat_outlier.m rename to src/ext/amri_eegfmri/amri_stat_outlier.m diff --git a/src/backroom/bsearch/bsearch.m b/src/ext/bsearch/bsearch.m similarity index 100% rename from src/backroom/bsearch/bsearch.m rename to src/ext/bsearch/bsearch.m diff --git a/src/backroom/bsearch/license.txt b/src/ext/bsearch/license.txt similarity index 100% rename from src/backroom/bsearch/license.txt rename to src/ext/bsearch/license.txt diff --git a/src/matlabbatch/@cfg_branch/all_leafs.m b/src/ext/matlabbatch/@cfg_branch/all_leafs.m similarity index 100% rename from src/matlabbatch/@cfg_branch/all_leafs.m rename to src/ext/matlabbatch/@cfg_branch/all_leafs.m diff --git a/src/matlabbatch/@cfg_branch/all_set.m b/src/ext/matlabbatch/@cfg_branch/all_set.m similarity index 100% rename from src/matlabbatch/@cfg_branch/all_set.m rename to src/ext/matlabbatch/@cfg_branch/all_set.m diff --git a/src/matlabbatch/@cfg_branch/all_set_item.m b/src/ext/matlabbatch/@cfg_branch/all_set_item.m similarity index 100% rename from src/matlabbatch/@cfg_branch/all_set_item.m rename to src/ext/matlabbatch/@cfg_branch/all_set_item.m diff --git a/src/matlabbatch/@cfg_branch/cfg2jobsubs.m b/src/ext/matlabbatch/@cfg_branch/cfg2jobsubs.m similarity index 100% rename from src/matlabbatch/@cfg_branch/cfg2jobsubs.m rename to src/ext/matlabbatch/@cfg_branch/cfg2jobsubs.m diff --git a/src/matlabbatch/@cfg_branch/cfg2struct.m b/src/ext/matlabbatch/@cfg_branch/cfg2struct.m similarity index 100% rename from src/matlabbatch/@cfg_branch/cfg2struct.m rename to src/ext/matlabbatch/@cfg_branch/cfg2struct.m diff --git a/src/matlabbatch/@cfg_branch/cfg_branch.m b/src/ext/matlabbatch/@cfg_branch/cfg_branch.m similarity index 100% rename from src/matlabbatch/@cfg_branch/cfg_branch.m rename to src/ext/matlabbatch/@cfg_branch/cfg_branch.m diff --git a/src/matlabbatch/@cfg_branch/checksubs_job.m b/src/ext/matlabbatch/@cfg_branch/checksubs_job.m similarity index 100% rename from src/matlabbatch/@cfg_branch/checksubs_job.m rename to src/ext/matlabbatch/@cfg_branch/checksubs_job.m diff --git a/src/matlabbatch/@cfg_branch/clearval.m b/src/ext/matlabbatch/@cfg_branch/clearval.m similarity index 100% rename from src/matlabbatch/@cfg_branch/clearval.m rename to src/ext/matlabbatch/@cfg_branch/clearval.m diff --git a/src/matlabbatch/@cfg_branch/expand.m b/src/ext/matlabbatch/@cfg_branch/expand.m similarity index 100% rename from src/matlabbatch/@cfg_branch/expand.m rename to src/ext/matlabbatch/@cfg_branch/expand.m diff --git a/src/matlabbatch/@cfg_branch/fillvals.m b/src/ext/matlabbatch/@cfg_branch/fillvals.m similarity index 100% rename from src/matlabbatch/@cfg_branch/fillvals.m rename to src/ext/matlabbatch/@cfg_branch/fillvals.m diff --git a/src/matlabbatch/@cfg_branch/harvest.m b/src/ext/matlabbatch/@cfg_branch/harvest.m similarity index 100% rename from src/matlabbatch/@cfg_branch/harvest.m rename to src/ext/matlabbatch/@cfg_branch/harvest.m diff --git a/src/matlabbatch/@cfg_branch/initialise.m b/src/ext/matlabbatch/@cfg_branch/initialise.m similarity index 100% rename from src/matlabbatch/@cfg_branch/initialise.m rename to src/ext/matlabbatch/@cfg_branch/initialise.m diff --git a/src/matlabbatch/@cfg_branch/list.m b/src/ext/matlabbatch/@cfg_branch/list.m similarity index 100% rename from src/matlabbatch/@cfg_branch/list.m rename to src/ext/matlabbatch/@cfg_branch/list.m diff --git a/src/matlabbatch/@cfg_branch/private/mysubs_fields.m b/src/ext/matlabbatch/@cfg_branch/private/mysubs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_branch/private/mysubs_fields.m rename to src/ext/matlabbatch/@cfg_branch/private/mysubs_fields.m diff --git a/src/matlabbatch/@cfg_branch/setval.m b/src/ext/matlabbatch/@cfg_branch/setval.m similarity index 100% rename from src/matlabbatch/@cfg_branch/setval.m rename to src/ext/matlabbatch/@cfg_branch/setval.m diff --git a/src/matlabbatch/@cfg_branch/showdetail.m b/src/ext/matlabbatch/@cfg_branch/showdetail.m similarity index 100% rename from src/matlabbatch/@cfg_branch/showdetail.m rename to src/ext/matlabbatch/@cfg_branch/showdetail.m diff --git a/src/matlabbatch/@cfg_branch/showdoc.m b/src/ext/matlabbatch/@cfg_branch/showdoc.m similarity index 100% rename from src/matlabbatch/@cfg_branch/showdoc.m rename to src/ext/matlabbatch/@cfg_branch/showdoc.m diff --git a/src/matlabbatch/@cfg_branch/showmydoc.m b/src/ext/matlabbatch/@cfg_branch/showmydoc.m similarity index 100% rename from src/matlabbatch/@cfg_branch/showmydoc.m rename to src/ext/matlabbatch/@cfg_branch/showmydoc.m diff --git a/src/matlabbatch/@cfg_branch/subs_fields.m b/src/ext/matlabbatch/@cfg_branch/subs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_branch/subs_fields.m rename to src/ext/matlabbatch/@cfg_branch/subs_fields.m diff --git a/src/matlabbatch/@cfg_branch/subsasgn.m b/src/ext/matlabbatch/@cfg_branch/subsasgn.m similarity index 100% rename from src/matlabbatch/@cfg_branch/subsasgn.m rename to src/ext/matlabbatch/@cfg_branch/subsasgn.m diff --git a/src/matlabbatch/@cfg_branch/subsasgn_check.m b/src/ext/matlabbatch/@cfg_branch/subsasgn_check.m similarity index 100% rename from src/matlabbatch/@cfg_branch/subsasgn_check.m rename to src/ext/matlabbatch/@cfg_branch/subsasgn_check.m diff --git a/src/matlabbatch/@cfg_branch/subsasgn_job.m b/src/ext/matlabbatch/@cfg_branch/subsasgn_job.m similarity index 100% rename from src/matlabbatch/@cfg_branch/subsasgn_job.m rename to src/ext/matlabbatch/@cfg_branch/subsasgn_job.m diff --git a/src/matlabbatch/@cfg_branch/subsref.m b/src/ext/matlabbatch/@cfg_branch/subsref.m similarity index 100% rename from src/matlabbatch/@cfg_branch/subsref.m rename to src/ext/matlabbatch/@cfg_branch/subsref.m diff --git a/src/matlabbatch/@cfg_branch/subsref_job.m b/src/ext/matlabbatch/@cfg_branch/subsref_job.m similarity index 100% rename from src/matlabbatch/@cfg_branch/subsref_job.m rename to src/ext/matlabbatch/@cfg_branch/subsref_job.m diff --git a/src/matlabbatch/@cfg_branch/tag2cfgsubs.m b/src/ext/matlabbatch/@cfg_branch/tag2cfgsubs.m similarity index 100% rename from src/matlabbatch/@cfg_branch/tag2cfgsubs.m rename to src/ext/matlabbatch/@cfg_branch/tag2cfgsubs.m diff --git a/src/matlabbatch/@cfg_branch/tagnames.m b/src/ext/matlabbatch/@cfg_branch/tagnames.m similarity index 100% rename from src/matlabbatch/@cfg_branch/tagnames.m rename to src/ext/matlabbatch/@cfg_branch/tagnames.m diff --git a/src/matlabbatch/@cfg_branch/treepart.m b/src/ext/matlabbatch/@cfg_branch/treepart.m similarity index 100% rename from src/matlabbatch/@cfg_branch/treepart.m rename to src/ext/matlabbatch/@cfg_branch/treepart.m diff --git a/src/matlabbatch/@cfg_branch/update_deps.m b/src/ext/matlabbatch/@cfg_branch/update_deps.m similarity index 100% rename from src/matlabbatch/@cfg_branch/update_deps.m rename to src/ext/matlabbatch/@cfg_branch/update_deps.m diff --git a/src/matlabbatch/@cfg_branch/val2def.m b/src/ext/matlabbatch/@cfg_branch/val2def.m similarity index 100% rename from src/matlabbatch/@cfg_branch/val2def.m rename to src/ext/matlabbatch/@cfg_branch/val2def.m diff --git a/src/matlabbatch/@cfg_choice/all_leafs.m b/src/ext/matlabbatch/@cfg_choice/all_leafs.m similarity index 100% rename from src/matlabbatch/@cfg_choice/all_leafs.m rename to src/ext/matlabbatch/@cfg_choice/all_leafs.m diff --git a/src/matlabbatch/@cfg_choice/all_set.m b/src/ext/matlabbatch/@cfg_choice/all_set.m similarity index 100% rename from src/matlabbatch/@cfg_choice/all_set.m rename to src/ext/matlabbatch/@cfg_choice/all_set.m diff --git a/src/matlabbatch/@cfg_choice/all_set_item.m b/src/ext/matlabbatch/@cfg_choice/all_set_item.m similarity index 100% rename from src/matlabbatch/@cfg_choice/all_set_item.m rename to src/ext/matlabbatch/@cfg_choice/all_set_item.m diff --git a/src/matlabbatch/@cfg_choice/cfg2jobsubs.m b/src/ext/matlabbatch/@cfg_choice/cfg2jobsubs.m similarity index 100% rename from src/matlabbatch/@cfg_choice/cfg2jobsubs.m rename to src/ext/matlabbatch/@cfg_choice/cfg2jobsubs.m diff --git a/src/matlabbatch/@cfg_choice/cfg2struct.m b/src/ext/matlabbatch/@cfg_choice/cfg2struct.m similarity index 100% rename from src/matlabbatch/@cfg_choice/cfg2struct.m rename to src/ext/matlabbatch/@cfg_choice/cfg2struct.m diff --git a/src/matlabbatch/@cfg_choice/cfg_choice.m b/src/ext/matlabbatch/@cfg_choice/cfg_choice.m similarity index 100% rename from src/matlabbatch/@cfg_choice/cfg_choice.m rename to src/ext/matlabbatch/@cfg_choice/cfg_choice.m diff --git a/src/matlabbatch/@cfg_choice/checksubs_job.m b/src/ext/matlabbatch/@cfg_choice/checksubs_job.m similarity index 100% rename from src/matlabbatch/@cfg_choice/checksubs_job.m rename to src/ext/matlabbatch/@cfg_choice/checksubs_job.m diff --git a/src/matlabbatch/@cfg_choice/clearval.m b/src/ext/matlabbatch/@cfg_choice/clearval.m similarity index 100% rename from src/matlabbatch/@cfg_choice/clearval.m rename to src/ext/matlabbatch/@cfg_choice/clearval.m diff --git a/src/matlabbatch/@cfg_choice/expand.m b/src/ext/matlabbatch/@cfg_choice/expand.m similarity index 100% rename from src/matlabbatch/@cfg_choice/expand.m rename to src/ext/matlabbatch/@cfg_choice/expand.m diff --git a/src/matlabbatch/@cfg_choice/fieldnames.m b/src/ext/matlabbatch/@cfg_choice/fieldnames.m similarity index 100% rename from src/matlabbatch/@cfg_choice/fieldnames.m rename to src/ext/matlabbatch/@cfg_choice/fieldnames.m diff --git a/src/matlabbatch/@cfg_choice/fillvals.m b/src/ext/matlabbatch/@cfg_choice/fillvals.m similarity index 100% rename from src/matlabbatch/@cfg_choice/fillvals.m rename to src/ext/matlabbatch/@cfg_choice/fillvals.m diff --git a/src/matlabbatch/@cfg_choice/gencode_item.m b/src/ext/matlabbatch/@cfg_choice/gencode_item.m similarity index 100% rename from src/matlabbatch/@cfg_choice/gencode_item.m rename to src/ext/matlabbatch/@cfg_choice/gencode_item.m diff --git a/src/matlabbatch/@cfg_choice/harvest.m b/src/ext/matlabbatch/@cfg_choice/harvest.m similarity index 100% rename from src/matlabbatch/@cfg_choice/harvest.m rename to src/ext/matlabbatch/@cfg_choice/harvest.m diff --git a/src/matlabbatch/@cfg_choice/initialise.m b/src/ext/matlabbatch/@cfg_choice/initialise.m similarity index 100% rename from src/matlabbatch/@cfg_choice/initialise.m rename to src/ext/matlabbatch/@cfg_choice/initialise.m diff --git a/src/matlabbatch/@cfg_choice/list.m b/src/ext/matlabbatch/@cfg_choice/list.m similarity index 100% rename from src/matlabbatch/@cfg_choice/list.m rename to src/ext/matlabbatch/@cfg_choice/list.m diff --git a/src/matlabbatch/@cfg_choice/private/mysubs_fields.m b/src/ext/matlabbatch/@cfg_choice/private/mysubs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_choice/private/mysubs_fields.m rename to src/ext/matlabbatch/@cfg_choice/private/mysubs_fields.m diff --git a/src/matlabbatch/@cfg_choice/setval.m b/src/ext/matlabbatch/@cfg_choice/setval.m similarity index 100% rename from src/matlabbatch/@cfg_choice/setval.m rename to src/ext/matlabbatch/@cfg_choice/setval.m diff --git a/src/matlabbatch/@cfg_choice/showdetail.m b/src/ext/matlabbatch/@cfg_choice/showdetail.m similarity index 100% rename from src/matlabbatch/@cfg_choice/showdetail.m rename to src/ext/matlabbatch/@cfg_choice/showdetail.m diff --git a/src/matlabbatch/@cfg_choice/showdoc.m b/src/ext/matlabbatch/@cfg_choice/showdoc.m similarity index 100% rename from src/matlabbatch/@cfg_choice/showdoc.m rename to src/ext/matlabbatch/@cfg_choice/showdoc.m diff --git a/src/matlabbatch/@cfg_choice/showmydoc.m b/src/ext/matlabbatch/@cfg_choice/showmydoc.m similarity index 100% rename from src/matlabbatch/@cfg_choice/showmydoc.m rename to src/ext/matlabbatch/@cfg_choice/showmydoc.m diff --git a/src/matlabbatch/@cfg_choice/subs_fields.m b/src/ext/matlabbatch/@cfg_choice/subs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_choice/subs_fields.m rename to src/ext/matlabbatch/@cfg_choice/subs_fields.m diff --git a/src/matlabbatch/@cfg_choice/subsasgn.m b/src/ext/matlabbatch/@cfg_choice/subsasgn.m similarity index 100% rename from src/matlabbatch/@cfg_choice/subsasgn.m rename to src/ext/matlabbatch/@cfg_choice/subsasgn.m diff --git a/src/matlabbatch/@cfg_choice/subsasgn_check.m b/src/ext/matlabbatch/@cfg_choice/subsasgn_check.m similarity index 100% rename from src/matlabbatch/@cfg_choice/subsasgn_check.m rename to src/ext/matlabbatch/@cfg_choice/subsasgn_check.m diff --git a/src/matlabbatch/@cfg_choice/subsasgn_job.m b/src/ext/matlabbatch/@cfg_choice/subsasgn_job.m similarity index 100% rename from src/matlabbatch/@cfg_choice/subsasgn_job.m rename to src/ext/matlabbatch/@cfg_choice/subsasgn_job.m diff --git a/src/matlabbatch/@cfg_choice/subsref.m b/src/ext/matlabbatch/@cfg_choice/subsref.m similarity index 100% rename from src/matlabbatch/@cfg_choice/subsref.m rename to src/ext/matlabbatch/@cfg_choice/subsref.m diff --git a/src/matlabbatch/@cfg_choice/subsref_job.m b/src/ext/matlabbatch/@cfg_choice/subsref_job.m similarity index 100% rename from src/matlabbatch/@cfg_choice/subsref_job.m rename to src/ext/matlabbatch/@cfg_choice/subsref_job.m diff --git a/src/matlabbatch/@cfg_choice/tag2cfgsubs.m b/src/ext/matlabbatch/@cfg_choice/tag2cfgsubs.m similarity index 100% rename from src/matlabbatch/@cfg_choice/tag2cfgsubs.m rename to src/ext/matlabbatch/@cfg_choice/tag2cfgsubs.m diff --git a/src/matlabbatch/@cfg_choice/tagnames.m b/src/ext/matlabbatch/@cfg_choice/tagnames.m similarity index 100% rename from src/matlabbatch/@cfg_choice/tagnames.m rename to src/ext/matlabbatch/@cfg_choice/tagnames.m diff --git a/src/matlabbatch/@cfg_choice/treepart.m b/src/ext/matlabbatch/@cfg_choice/treepart.m similarity index 100% rename from src/matlabbatch/@cfg_choice/treepart.m rename to src/ext/matlabbatch/@cfg_choice/treepart.m diff --git a/src/matlabbatch/@cfg_choice/update_deps.m b/src/ext/matlabbatch/@cfg_choice/update_deps.m similarity index 100% rename from src/matlabbatch/@cfg_choice/update_deps.m rename to src/ext/matlabbatch/@cfg_choice/update_deps.m diff --git a/src/matlabbatch/@cfg_choice/val2def.m b/src/ext/matlabbatch/@cfg_choice/val2def.m similarity index 100% rename from src/matlabbatch/@cfg_choice/val2def.m rename to src/ext/matlabbatch/@cfg_choice/val2def.m diff --git a/src/matlabbatch/@cfg_const/cfg2struct.m b/src/ext/matlabbatch/@cfg_const/cfg2struct.m similarity index 100% rename from src/matlabbatch/@cfg_const/cfg2struct.m rename to src/ext/matlabbatch/@cfg_const/cfg2struct.m diff --git a/src/matlabbatch/@cfg_const/cfg_const.m b/src/ext/matlabbatch/@cfg_const/cfg_const.m similarity index 100% rename from src/matlabbatch/@cfg_const/cfg_const.m rename to src/ext/matlabbatch/@cfg_const/cfg_const.m diff --git a/src/matlabbatch/@cfg_const/private/mysubs_fields.m b/src/ext/matlabbatch/@cfg_const/private/mysubs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_const/private/mysubs_fields.m rename to src/ext/matlabbatch/@cfg_const/private/mysubs_fields.m diff --git a/src/matlabbatch/@cfg_const/showdetail.m b/src/ext/matlabbatch/@cfg_const/showdetail.m similarity index 100% rename from src/matlabbatch/@cfg_const/showdetail.m rename to src/ext/matlabbatch/@cfg_const/showdetail.m diff --git a/src/matlabbatch/@cfg_const/showdoc.m b/src/ext/matlabbatch/@cfg_const/showdoc.m similarity index 100% rename from src/matlabbatch/@cfg_const/showdoc.m rename to src/ext/matlabbatch/@cfg_const/showdoc.m diff --git a/src/matlabbatch/@cfg_const/subs_fields.m b/src/ext/matlabbatch/@cfg_const/subs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_const/subs_fields.m rename to src/ext/matlabbatch/@cfg_const/subs_fields.m diff --git a/src/matlabbatch/@cfg_const/subsasgn.m b/src/ext/matlabbatch/@cfg_const/subsasgn.m similarity index 100% rename from src/matlabbatch/@cfg_const/subsasgn.m rename to src/ext/matlabbatch/@cfg_const/subsasgn.m diff --git a/src/matlabbatch/@cfg_const/subsref.m b/src/ext/matlabbatch/@cfg_const/subsref.m similarity index 100% rename from src/matlabbatch/@cfg_const/subsref.m rename to src/ext/matlabbatch/@cfg_const/subsref.m diff --git a/src/matlabbatch/@cfg_dep/add_to_source.m b/src/ext/matlabbatch/@cfg_dep/add_to_source.m similarity index 100% rename from src/matlabbatch/@cfg_dep/add_to_source.m rename to src/ext/matlabbatch/@cfg_dep/add_to_source.m diff --git a/src/matlabbatch/@cfg_dep/cfg_dep.m b/src/ext/matlabbatch/@cfg_dep/cfg_dep.m similarity index 100% rename from src/matlabbatch/@cfg_dep/cfg_dep.m rename to src/ext/matlabbatch/@cfg_dep/cfg_dep.m diff --git a/src/matlabbatch/@cfg_dep/del_in_source.m b/src/ext/matlabbatch/@cfg_dep/del_in_source.m similarity index 100% rename from src/matlabbatch/@cfg_dep/del_in_source.m rename to src/ext/matlabbatch/@cfg_dep/del_in_source.m diff --git a/src/matlabbatch/@cfg_dep/del_in_target.m b/src/ext/matlabbatch/@cfg_dep/del_in_target.m similarity index 100% rename from src/matlabbatch/@cfg_dep/del_in_target.m rename to src/ext/matlabbatch/@cfg_dep/del_in_target.m diff --git a/src/matlabbatch/@cfg_dep/dep_add.m b/src/ext/matlabbatch/@cfg_dep/dep_add.m similarity index 100% rename from src/matlabbatch/@cfg_dep/dep_add.m rename to src/ext/matlabbatch/@cfg_dep/dep_add.m diff --git a/src/matlabbatch/@cfg_dep/disp.m b/src/ext/matlabbatch/@cfg_dep/disp.m similarity index 100% rename from src/matlabbatch/@cfg_dep/disp.m rename to src/ext/matlabbatch/@cfg_dep/disp.m diff --git a/src/matlabbatch/@cfg_dep/display.m b/src/ext/matlabbatch/@cfg_dep/display.m similarity index 100% rename from src/matlabbatch/@cfg_dep/display.m rename to src/ext/matlabbatch/@cfg_dep/display.m diff --git a/src/matlabbatch/@cfg_dep/gencode.m b/src/ext/matlabbatch/@cfg_dep/gencode.m similarity index 100% rename from src/matlabbatch/@cfg_dep/gencode.m rename to src/ext/matlabbatch/@cfg_dep/gencode.m diff --git a/src/matlabbatch/@cfg_dep/isequalsource.m b/src/ext/matlabbatch/@cfg_dep/isequalsource.m similarity index 100% rename from src/matlabbatch/@cfg_dep/isequalsource.m rename to src/ext/matlabbatch/@cfg_dep/isequalsource.m diff --git a/src/matlabbatch/@cfg_dep/isequaltarget.m b/src/ext/matlabbatch/@cfg_dep/isequaltarget.m similarity index 100% rename from src/matlabbatch/@cfg_dep/isequaltarget.m rename to src/ext/matlabbatch/@cfg_dep/isequaltarget.m diff --git a/src/matlabbatch/@cfg_dep/private/mysubs_fields.m b/src/ext/matlabbatch/@cfg_dep/private/mysubs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_dep/private/mysubs_fields.m rename to src/ext/matlabbatch/@cfg_dep/private/mysubs_fields.m diff --git a/src/matlabbatch/@cfg_dep/subs_fields.m b/src/ext/matlabbatch/@cfg_dep/subs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_dep/subs_fields.m rename to src/ext/matlabbatch/@cfg_dep/subs_fields.m diff --git a/src/matlabbatch/@cfg_dep/subsasgn.m b/src/ext/matlabbatch/@cfg_dep/subsasgn.m similarity index 100% rename from src/matlabbatch/@cfg_dep/subsasgn.m rename to src/ext/matlabbatch/@cfg_dep/subsasgn.m diff --git a/src/matlabbatch/@cfg_dep/subsref.m b/src/ext/matlabbatch/@cfg_dep/subsref.m similarity index 100% rename from src/matlabbatch/@cfg_dep/subsref.m rename to src/ext/matlabbatch/@cfg_dep/subsref.m diff --git a/src/matlabbatch/@cfg_dep/update_deps.m b/src/ext/matlabbatch/@cfg_dep/update_deps.m similarity index 100% rename from src/matlabbatch/@cfg_dep/update_deps.m rename to src/ext/matlabbatch/@cfg_dep/update_deps.m diff --git a/src/matlabbatch/@cfg_entry/cfg2struct.m b/src/ext/matlabbatch/@cfg_entry/cfg2struct.m similarity index 100% rename from src/matlabbatch/@cfg_entry/cfg2struct.m rename to src/ext/matlabbatch/@cfg_entry/cfg2struct.m diff --git a/src/matlabbatch/@cfg_entry/cfg_entry.m b/src/ext/matlabbatch/@cfg_entry/cfg_entry.m similarity index 100% rename from src/matlabbatch/@cfg_entry/cfg_entry.m rename to src/ext/matlabbatch/@cfg_entry/cfg_entry.m diff --git a/src/matlabbatch/@cfg_entry/fieldnames.m b/src/ext/matlabbatch/@cfg_entry/fieldnames.m similarity index 100% rename from src/matlabbatch/@cfg_entry/fieldnames.m rename to src/ext/matlabbatch/@cfg_entry/fieldnames.m diff --git a/src/matlabbatch/@cfg_entry/gencode_item.m b/src/ext/matlabbatch/@cfg_entry/gencode_item.m similarity index 100% rename from src/matlabbatch/@cfg_entry/gencode_item.m rename to src/ext/matlabbatch/@cfg_entry/gencode_item.m diff --git a/src/matlabbatch/@cfg_entry/match.m b/src/ext/matlabbatch/@cfg_entry/match.m similarity index 100% rename from src/matlabbatch/@cfg_entry/match.m rename to src/ext/matlabbatch/@cfg_entry/match.m diff --git a/src/matlabbatch/@cfg_entry/private/mysubs_fields.m b/src/ext/matlabbatch/@cfg_entry/private/mysubs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_entry/private/mysubs_fields.m rename to src/ext/matlabbatch/@cfg_entry/private/mysubs_fields.m diff --git a/src/matlabbatch/@cfg_entry/showdetail.m b/src/ext/matlabbatch/@cfg_entry/showdetail.m similarity index 100% rename from src/matlabbatch/@cfg_entry/showdetail.m rename to src/ext/matlabbatch/@cfg_entry/showdetail.m diff --git a/src/matlabbatch/@cfg_entry/showdoc.m b/src/ext/matlabbatch/@cfg_entry/showdoc.m similarity index 100% rename from src/matlabbatch/@cfg_entry/showdoc.m rename to src/ext/matlabbatch/@cfg_entry/showdoc.m diff --git a/src/matlabbatch/@cfg_entry/subs_fields.m b/src/ext/matlabbatch/@cfg_entry/subs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_entry/subs_fields.m rename to src/ext/matlabbatch/@cfg_entry/subs_fields.m diff --git a/src/matlabbatch/@cfg_entry/subsasgn.m b/src/ext/matlabbatch/@cfg_entry/subsasgn.m similarity index 100% rename from src/matlabbatch/@cfg_entry/subsasgn.m rename to src/ext/matlabbatch/@cfg_entry/subsasgn.m diff --git a/src/matlabbatch/@cfg_entry/subsasgn_check.m b/src/ext/matlabbatch/@cfg_entry/subsasgn_check.m similarity index 100% rename from src/matlabbatch/@cfg_entry/subsasgn_check.m rename to src/ext/matlabbatch/@cfg_entry/subsasgn_check.m diff --git a/src/matlabbatch/@cfg_entry/subsref.m b/src/ext/matlabbatch/@cfg_entry/subsref.m similarity index 100% rename from src/matlabbatch/@cfg_entry/subsref.m rename to src/ext/matlabbatch/@cfg_entry/subsref.m diff --git a/src/matlabbatch/@cfg_exbranch/cfg2struct.m b/src/ext/matlabbatch/@cfg_exbranch/cfg2struct.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/cfg2struct.m rename to src/ext/matlabbatch/@cfg_exbranch/cfg2struct.m diff --git a/src/matlabbatch/@cfg_exbranch/cfg_exbranch.m b/src/ext/matlabbatch/@cfg_exbranch/cfg_exbranch.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/cfg_exbranch.m rename to src/ext/matlabbatch/@cfg_exbranch/cfg_exbranch.m diff --git a/src/matlabbatch/@cfg_exbranch/disp.m b/src/ext/matlabbatch/@cfg_exbranch/disp.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/disp.m rename to src/ext/matlabbatch/@cfg_exbranch/disp.m diff --git a/src/matlabbatch/@cfg_exbranch/display.m b/src/ext/matlabbatch/@cfg_exbranch/display.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/display.m rename to src/ext/matlabbatch/@cfg_exbranch/display.m diff --git a/src/matlabbatch/@cfg_exbranch/fieldnames.m b/src/ext/matlabbatch/@cfg_exbranch/fieldnames.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/fieldnames.m rename to src/ext/matlabbatch/@cfg_exbranch/fieldnames.m diff --git a/src/matlabbatch/@cfg_exbranch/gencode_item.m b/src/ext/matlabbatch/@cfg_exbranch/gencode_item.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/gencode_item.m rename to src/ext/matlabbatch/@cfg_exbranch/gencode_item.m diff --git a/src/matlabbatch/@cfg_exbranch/harvest.m b/src/ext/matlabbatch/@cfg_exbranch/harvest.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/harvest.m rename to src/ext/matlabbatch/@cfg_exbranch/harvest.m diff --git a/src/matlabbatch/@cfg_exbranch/private/mysubs_fields.m b/src/ext/matlabbatch/@cfg_exbranch/private/mysubs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/private/mysubs_fields.m rename to src/ext/matlabbatch/@cfg_exbranch/private/mysubs_fields.m diff --git a/src/matlabbatch/@cfg_exbranch/showdetail.m b/src/ext/matlabbatch/@cfg_exbranch/showdetail.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/showdetail.m rename to src/ext/matlabbatch/@cfg_exbranch/showdetail.m diff --git a/src/matlabbatch/@cfg_exbranch/subs_fields.m b/src/ext/matlabbatch/@cfg_exbranch/subs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/subs_fields.m rename to src/ext/matlabbatch/@cfg_exbranch/subs_fields.m diff --git a/src/matlabbatch/@cfg_exbranch/subsasgn.m b/src/ext/matlabbatch/@cfg_exbranch/subsasgn.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/subsasgn.m rename to src/ext/matlabbatch/@cfg_exbranch/subsasgn.m diff --git a/src/matlabbatch/@cfg_exbranch/subsasgn_check.m b/src/ext/matlabbatch/@cfg_exbranch/subsasgn_check.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/subsasgn_check.m rename to src/ext/matlabbatch/@cfg_exbranch/subsasgn_check.m diff --git a/src/matlabbatch/@cfg_exbranch/subsref.m b/src/ext/matlabbatch/@cfg_exbranch/subsref.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/subsref.m rename to src/ext/matlabbatch/@cfg_exbranch/subsref.m diff --git a/src/matlabbatch/@cfg_exbranch/update_deps.m b/src/ext/matlabbatch/@cfg_exbranch/update_deps.m similarity index 100% rename from src/matlabbatch/@cfg_exbranch/update_deps.m rename to src/ext/matlabbatch/@cfg_exbranch/update_deps.m diff --git a/src/matlabbatch/@cfg_files/cfg2struct.m b/src/ext/matlabbatch/@cfg_files/cfg2struct.m similarity index 100% rename from src/matlabbatch/@cfg_files/cfg2struct.m rename to src/ext/matlabbatch/@cfg_files/cfg2struct.m diff --git a/src/matlabbatch/@cfg_files/cfg_files.m b/src/ext/matlabbatch/@cfg_files/cfg_files.m similarity index 100% rename from src/matlabbatch/@cfg_files/cfg_files.m rename to src/ext/matlabbatch/@cfg_files/cfg_files.m diff --git a/src/matlabbatch/@cfg_files/fieldnames.m b/src/ext/matlabbatch/@cfg_files/fieldnames.m similarity index 100% rename from src/matlabbatch/@cfg_files/fieldnames.m rename to src/ext/matlabbatch/@cfg_files/fieldnames.m diff --git a/src/matlabbatch/@cfg_files/gencode_item.m b/src/ext/matlabbatch/@cfg_files/gencode_item.m similarity index 100% rename from src/matlabbatch/@cfg_files/gencode_item.m rename to src/ext/matlabbatch/@cfg_files/gencode_item.m diff --git a/src/matlabbatch/@cfg_files/match.m b/src/ext/matlabbatch/@cfg_files/match.m similarity index 100% rename from src/matlabbatch/@cfg_files/match.m rename to src/ext/matlabbatch/@cfg_files/match.m diff --git a/src/matlabbatch/@cfg_files/private/mysubs_fields.m b/src/ext/matlabbatch/@cfg_files/private/mysubs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_files/private/mysubs_fields.m rename to src/ext/matlabbatch/@cfg_files/private/mysubs_fields.m diff --git a/src/matlabbatch/@cfg_files/showdetail.m b/src/ext/matlabbatch/@cfg_files/showdetail.m similarity index 100% rename from src/matlabbatch/@cfg_files/showdetail.m rename to src/ext/matlabbatch/@cfg_files/showdetail.m diff --git a/src/matlabbatch/@cfg_files/subs_fields.m b/src/ext/matlabbatch/@cfg_files/subs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_files/subs_fields.m rename to src/ext/matlabbatch/@cfg_files/subs_fields.m diff --git a/src/matlabbatch/@cfg_files/subsasgn.m b/src/ext/matlabbatch/@cfg_files/subsasgn.m similarity index 100% rename from src/matlabbatch/@cfg_files/subsasgn.m rename to src/ext/matlabbatch/@cfg_files/subsasgn.m diff --git a/src/matlabbatch/@cfg_files/subsasgn_check.m b/src/ext/matlabbatch/@cfg_files/subsasgn_check.m similarity index 100% rename from src/matlabbatch/@cfg_files/subsasgn_check.m rename to src/ext/matlabbatch/@cfg_files/subsasgn_check.m diff --git a/src/matlabbatch/@cfg_files/subsref.m b/src/ext/matlabbatch/@cfg_files/subsref.m similarity index 100% rename from src/matlabbatch/@cfg_files/subsref.m rename to src/ext/matlabbatch/@cfg_files/subsref.m diff --git a/src/matlabbatch/@cfg_intree/cfg_intree.m b/src/ext/matlabbatch/@cfg_intree/cfg_intree.m similarity index 100% rename from src/matlabbatch/@cfg_intree/cfg_intree.m rename to src/ext/matlabbatch/@cfg_intree/cfg_intree.m diff --git a/src/matlabbatch/@cfg_intree/disp.m b/src/ext/matlabbatch/@cfg_intree/disp.m similarity index 100% rename from src/matlabbatch/@cfg_intree/disp.m rename to src/ext/matlabbatch/@cfg_intree/disp.m diff --git a/src/matlabbatch/@cfg_intree/display.m b/src/ext/matlabbatch/@cfg_intree/display.m similarity index 100% rename from src/matlabbatch/@cfg_intree/display.m rename to src/ext/matlabbatch/@cfg_intree/display.m diff --git a/src/matlabbatch/@cfg_inv_out/cfg_inv_out.m b/src/ext/matlabbatch/@cfg_inv_out/cfg_inv_out.m similarity index 100% rename from src/matlabbatch/@cfg_inv_out/cfg_inv_out.m rename to src/ext/matlabbatch/@cfg_inv_out/cfg_inv_out.m diff --git a/src/matlabbatch/@cfg_item/all_leafs.m b/src/ext/matlabbatch/@cfg_item/all_leafs.m similarity index 100% rename from src/matlabbatch/@cfg_item/all_leafs.m rename to src/ext/matlabbatch/@cfg_item/all_leafs.m diff --git a/src/matlabbatch/@cfg_item/all_set.m b/src/ext/matlabbatch/@cfg_item/all_set.m similarity index 100% rename from src/matlabbatch/@cfg_item/all_set.m rename to src/ext/matlabbatch/@cfg_item/all_set.m diff --git a/src/matlabbatch/@cfg_item/all_set_item.m b/src/ext/matlabbatch/@cfg_item/all_set_item.m similarity index 100% rename from src/matlabbatch/@cfg_item/all_set_item.m rename to src/ext/matlabbatch/@cfg_item/all_set_item.m diff --git a/src/matlabbatch/@cfg_item/cat.m b/src/ext/matlabbatch/@cfg_item/cat.m similarity index 100% rename from src/matlabbatch/@cfg_item/cat.m rename to src/ext/matlabbatch/@cfg_item/cat.m diff --git a/src/matlabbatch/@cfg_item/cfg2jobsubs.m b/src/ext/matlabbatch/@cfg_item/cfg2jobsubs.m similarity index 100% rename from src/matlabbatch/@cfg_item/cfg2jobsubs.m rename to src/ext/matlabbatch/@cfg_item/cfg2jobsubs.m diff --git a/src/matlabbatch/@cfg_item/cfg2struct.m b/src/ext/matlabbatch/@cfg_item/cfg2struct.m similarity index 100% rename from src/matlabbatch/@cfg_item/cfg2struct.m rename to src/ext/matlabbatch/@cfg_item/cfg2struct.m diff --git a/src/matlabbatch/@cfg_item/cfg_item.m b/src/ext/matlabbatch/@cfg_item/cfg_item.m similarity index 100% rename from src/matlabbatch/@cfg_item/cfg_item.m rename to src/ext/matlabbatch/@cfg_item/cfg_item.m diff --git a/src/matlabbatch/@cfg_item/clearval.m b/src/ext/matlabbatch/@cfg_item/clearval.m similarity index 100% rename from src/matlabbatch/@cfg_item/clearval.m rename to src/ext/matlabbatch/@cfg_item/clearval.m diff --git a/src/matlabbatch/@cfg_item/disp.m b/src/ext/matlabbatch/@cfg_item/disp.m similarity index 100% rename from src/matlabbatch/@cfg_item/disp.m rename to src/ext/matlabbatch/@cfg_item/disp.m diff --git a/src/matlabbatch/@cfg_item/display.m b/src/ext/matlabbatch/@cfg_item/display.m similarity index 100% rename from src/matlabbatch/@cfg_item/display.m rename to src/ext/matlabbatch/@cfg_item/display.m diff --git a/src/matlabbatch/@cfg_item/docheck.m b/src/ext/matlabbatch/@cfg_item/docheck.m similarity index 100% rename from src/matlabbatch/@cfg_item/docheck.m rename to src/ext/matlabbatch/@cfg_item/docheck.m diff --git a/src/matlabbatch/@cfg_item/expand.m b/src/ext/matlabbatch/@cfg_item/expand.m similarity index 100% rename from src/matlabbatch/@cfg_item/expand.m rename to src/ext/matlabbatch/@cfg_item/expand.m diff --git a/src/matlabbatch/@cfg_item/fieldnames.m b/src/ext/matlabbatch/@cfg_item/fieldnames.m similarity index 100% rename from src/matlabbatch/@cfg_item/fieldnames.m rename to src/ext/matlabbatch/@cfg_item/fieldnames.m diff --git a/src/matlabbatch/@cfg_item/fillvals.m b/src/ext/matlabbatch/@cfg_item/fillvals.m similarity index 100% rename from src/matlabbatch/@cfg_item/fillvals.m rename to src/ext/matlabbatch/@cfg_item/fillvals.m diff --git a/src/matlabbatch/@cfg_item/gencode.m b/src/ext/matlabbatch/@cfg_item/gencode.m similarity index 100% rename from src/matlabbatch/@cfg_item/gencode.m rename to src/ext/matlabbatch/@cfg_item/gencode.m diff --git a/src/matlabbatch/@cfg_item/gencode_item.m b/src/ext/matlabbatch/@cfg_item/gencode_item.m similarity index 100% rename from src/matlabbatch/@cfg_item/gencode_item.m rename to src/ext/matlabbatch/@cfg_item/gencode_item.m diff --git a/src/matlabbatch/@cfg_item/gettag.m b/src/ext/matlabbatch/@cfg_item/gettag.m similarity index 100% rename from src/matlabbatch/@cfg_item/gettag.m rename to src/ext/matlabbatch/@cfg_item/gettag.m diff --git a/src/matlabbatch/@cfg_item/harvest.m b/src/ext/matlabbatch/@cfg_item/harvest.m similarity index 100% rename from src/matlabbatch/@cfg_item/harvest.m rename to src/ext/matlabbatch/@cfg_item/harvest.m diff --git a/src/matlabbatch/@cfg_item/horzcat.m b/src/ext/matlabbatch/@cfg_item/horzcat.m similarity index 100% rename from src/matlabbatch/@cfg_item/horzcat.m rename to src/ext/matlabbatch/@cfg_item/horzcat.m diff --git a/src/matlabbatch/@cfg_item/initialise.m b/src/ext/matlabbatch/@cfg_item/initialise.m similarity index 100% rename from src/matlabbatch/@cfg_item/initialise.m rename to src/ext/matlabbatch/@cfg_item/initialise.m diff --git a/src/matlabbatch/@cfg_item/list.m b/src/ext/matlabbatch/@cfg_item/list.m similarity index 100% rename from src/matlabbatch/@cfg_item/list.m rename to src/ext/matlabbatch/@cfg_item/list.m diff --git a/src/matlabbatch/@cfg_item/match.m b/src/ext/matlabbatch/@cfg_item/match.m similarity index 100% rename from src/matlabbatch/@cfg_item/match.m rename to src/ext/matlabbatch/@cfg_item/match.m diff --git a/src/matlabbatch/@cfg_item/private/mysubs_fields.m b/src/ext/matlabbatch/@cfg_item/private/mysubs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_item/private/mysubs_fields.m rename to src/ext/matlabbatch/@cfg_item/private/mysubs_fields.m diff --git a/src/matlabbatch/@cfg_item/resolve_deps.m b/src/ext/matlabbatch/@cfg_item/resolve_deps.m similarity index 100% rename from src/matlabbatch/@cfg_item/resolve_deps.m rename to src/ext/matlabbatch/@cfg_item/resolve_deps.m diff --git a/src/matlabbatch/@cfg_item/setval.m b/src/ext/matlabbatch/@cfg_item/setval.m similarity index 100% rename from src/matlabbatch/@cfg_item/setval.m rename to src/ext/matlabbatch/@cfg_item/setval.m diff --git a/src/matlabbatch/@cfg_item/showdetail.m b/src/ext/matlabbatch/@cfg_item/showdetail.m similarity index 100% rename from src/matlabbatch/@cfg_item/showdetail.m rename to src/ext/matlabbatch/@cfg_item/showdetail.m diff --git a/src/matlabbatch/@cfg_item/showdoc.m b/src/ext/matlabbatch/@cfg_item/showdoc.m similarity index 100% rename from src/matlabbatch/@cfg_item/showdoc.m rename to src/ext/matlabbatch/@cfg_item/showdoc.m diff --git a/src/matlabbatch/@cfg_item/subs_fields.m b/src/ext/matlabbatch/@cfg_item/subs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_item/subs_fields.m rename to src/ext/matlabbatch/@cfg_item/subs_fields.m diff --git a/src/matlabbatch/@cfg_item/subsasgn.m b/src/ext/matlabbatch/@cfg_item/subsasgn.m similarity index 100% rename from src/matlabbatch/@cfg_item/subsasgn.m rename to src/ext/matlabbatch/@cfg_item/subsasgn.m diff --git a/src/matlabbatch/@cfg_item/subsasgn_check.m b/src/ext/matlabbatch/@cfg_item/subsasgn_check.m similarity index 100% rename from src/matlabbatch/@cfg_item/subsasgn_check.m rename to src/ext/matlabbatch/@cfg_item/subsasgn_check.m diff --git a/src/matlabbatch/@cfg_item/subsasgn_checkstr.m b/src/ext/matlabbatch/@cfg_item/subsasgn_checkstr.m similarity index 100% rename from src/matlabbatch/@cfg_item/subsasgn_checkstr.m rename to src/ext/matlabbatch/@cfg_item/subsasgn_checkstr.m diff --git a/src/matlabbatch/@cfg_item/subsasgn_job.m b/src/ext/matlabbatch/@cfg_item/subsasgn_job.m similarity index 100% rename from src/matlabbatch/@cfg_item/subsasgn_job.m rename to src/ext/matlabbatch/@cfg_item/subsasgn_job.m diff --git a/src/matlabbatch/@cfg_item/subsref.m b/src/ext/matlabbatch/@cfg_item/subsref.m similarity index 100% rename from src/matlabbatch/@cfg_item/subsref.m rename to src/ext/matlabbatch/@cfg_item/subsref.m diff --git a/src/matlabbatch/@cfg_item/subsref_job.m b/src/ext/matlabbatch/@cfg_item/subsref_job.m similarity index 100% rename from src/matlabbatch/@cfg_item/subsref_job.m rename to src/ext/matlabbatch/@cfg_item/subsref_job.m diff --git a/src/matlabbatch/@cfg_item/tag2cfgsubs.m b/src/ext/matlabbatch/@cfg_item/tag2cfgsubs.m similarity index 100% rename from src/matlabbatch/@cfg_item/tag2cfgsubs.m rename to src/ext/matlabbatch/@cfg_item/tag2cfgsubs.m diff --git a/src/matlabbatch/@cfg_item/update_deps.m b/src/ext/matlabbatch/@cfg_item/update_deps.m similarity index 100% rename from src/matlabbatch/@cfg_item/update_deps.m rename to src/ext/matlabbatch/@cfg_item/update_deps.m diff --git a/src/matlabbatch/@cfg_item/val2def.m b/src/ext/matlabbatch/@cfg_item/val2def.m similarity index 100% rename from src/matlabbatch/@cfg_item/val2def.m rename to src/ext/matlabbatch/@cfg_item/val2def.m diff --git a/src/matlabbatch/@cfg_item/vertcat.m b/src/ext/matlabbatch/@cfg_item/vertcat.m similarity index 100% rename from src/matlabbatch/@cfg_item/vertcat.m rename to src/ext/matlabbatch/@cfg_item/vertcat.m diff --git a/src/matlabbatch/@cfg_leaf/cfg_leaf.m b/src/ext/matlabbatch/@cfg_leaf/cfg_leaf.m similarity index 100% rename from src/matlabbatch/@cfg_leaf/cfg_leaf.m rename to src/ext/matlabbatch/@cfg_leaf/cfg_leaf.m diff --git a/src/matlabbatch/@cfg_leaf/disp.m b/src/ext/matlabbatch/@cfg_leaf/disp.m similarity index 100% rename from src/matlabbatch/@cfg_leaf/disp.m rename to src/ext/matlabbatch/@cfg_leaf/disp.m diff --git a/src/matlabbatch/@cfg_leaf/display.m b/src/ext/matlabbatch/@cfg_leaf/display.m similarity index 100% rename from src/matlabbatch/@cfg_leaf/display.m rename to src/ext/matlabbatch/@cfg_leaf/display.m diff --git a/src/matlabbatch/@cfg_mchoice/all_leafs.m b/src/ext/matlabbatch/@cfg_mchoice/all_leafs.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/all_leafs.m rename to src/ext/matlabbatch/@cfg_mchoice/all_leafs.m diff --git a/src/matlabbatch/@cfg_mchoice/all_set.m b/src/ext/matlabbatch/@cfg_mchoice/all_set.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/all_set.m rename to src/ext/matlabbatch/@cfg_mchoice/all_set.m diff --git a/src/matlabbatch/@cfg_mchoice/all_set_item.m b/src/ext/matlabbatch/@cfg_mchoice/all_set_item.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/all_set_item.m rename to src/ext/matlabbatch/@cfg_mchoice/all_set_item.m diff --git a/src/matlabbatch/@cfg_mchoice/cfg2jobsubs.m b/src/ext/matlabbatch/@cfg_mchoice/cfg2jobsubs.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/cfg2jobsubs.m rename to src/ext/matlabbatch/@cfg_mchoice/cfg2jobsubs.m diff --git a/src/matlabbatch/@cfg_mchoice/cfg2struct.m b/src/ext/matlabbatch/@cfg_mchoice/cfg2struct.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/cfg2struct.m rename to src/ext/matlabbatch/@cfg_mchoice/cfg2struct.m diff --git a/src/matlabbatch/@cfg_mchoice/cfg_mchoice.m b/src/ext/matlabbatch/@cfg_mchoice/cfg_mchoice.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/cfg_mchoice.m rename to src/ext/matlabbatch/@cfg_mchoice/cfg_mchoice.m diff --git a/src/matlabbatch/@cfg_mchoice/checksubs_job.m b/src/ext/matlabbatch/@cfg_mchoice/checksubs_job.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/checksubs_job.m rename to src/ext/matlabbatch/@cfg_mchoice/checksubs_job.m diff --git a/src/matlabbatch/@cfg_mchoice/clearval.m b/src/ext/matlabbatch/@cfg_mchoice/clearval.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/clearval.m rename to src/ext/matlabbatch/@cfg_mchoice/clearval.m diff --git a/src/matlabbatch/@cfg_mchoice/expand.m b/src/ext/matlabbatch/@cfg_mchoice/expand.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/expand.m rename to src/ext/matlabbatch/@cfg_mchoice/expand.m diff --git a/src/matlabbatch/@cfg_mchoice/fieldnames.m b/src/ext/matlabbatch/@cfg_mchoice/fieldnames.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/fieldnames.m rename to src/ext/matlabbatch/@cfg_mchoice/fieldnames.m diff --git a/src/matlabbatch/@cfg_mchoice/fillvals.m b/src/ext/matlabbatch/@cfg_mchoice/fillvals.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/fillvals.m rename to src/ext/matlabbatch/@cfg_mchoice/fillvals.m diff --git a/src/matlabbatch/@cfg_mchoice/gencode_item.m b/src/ext/matlabbatch/@cfg_mchoice/gencode_item.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/gencode_item.m rename to src/ext/matlabbatch/@cfg_mchoice/gencode_item.m diff --git a/src/matlabbatch/@cfg_mchoice/harvest.m b/src/ext/matlabbatch/@cfg_mchoice/harvest.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/harvest.m rename to src/ext/matlabbatch/@cfg_mchoice/harvest.m diff --git a/src/matlabbatch/@cfg_mchoice/initialise.m b/src/ext/matlabbatch/@cfg_mchoice/initialise.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/initialise.m rename to src/ext/matlabbatch/@cfg_mchoice/initialise.m diff --git a/src/matlabbatch/@cfg_mchoice/list.m b/src/ext/matlabbatch/@cfg_mchoice/list.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/list.m rename to src/ext/matlabbatch/@cfg_mchoice/list.m diff --git a/src/matlabbatch/@cfg_mchoice/private/mysubs_fields.m b/src/ext/matlabbatch/@cfg_mchoice/private/mysubs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/private/mysubs_fields.m rename to src/ext/matlabbatch/@cfg_mchoice/private/mysubs_fields.m diff --git a/src/matlabbatch/@cfg_mchoice/setval.m b/src/ext/matlabbatch/@cfg_mchoice/setval.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/setval.m rename to src/ext/matlabbatch/@cfg_mchoice/setval.m diff --git a/src/matlabbatch/@cfg_mchoice/showdetail.m b/src/ext/matlabbatch/@cfg_mchoice/showdetail.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/showdetail.m rename to src/ext/matlabbatch/@cfg_mchoice/showdetail.m diff --git a/src/matlabbatch/@cfg_mchoice/showdoc.m b/src/ext/matlabbatch/@cfg_mchoice/showdoc.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/showdoc.m rename to src/ext/matlabbatch/@cfg_mchoice/showdoc.m diff --git a/src/matlabbatch/@cfg_mchoice/showmydoc.m b/src/ext/matlabbatch/@cfg_mchoice/showmydoc.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/showmydoc.m rename to src/ext/matlabbatch/@cfg_mchoice/showmydoc.m diff --git a/src/matlabbatch/@cfg_mchoice/subs_fields.m b/src/ext/matlabbatch/@cfg_mchoice/subs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/subs_fields.m rename to src/ext/matlabbatch/@cfg_mchoice/subs_fields.m diff --git a/src/matlabbatch/@cfg_mchoice/subsasgn.m b/src/ext/matlabbatch/@cfg_mchoice/subsasgn.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/subsasgn.m rename to src/ext/matlabbatch/@cfg_mchoice/subsasgn.m diff --git a/src/matlabbatch/@cfg_mchoice/subsasgn_check.m b/src/ext/matlabbatch/@cfg_mchoice/subsasgn_check.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/subsasgn_check.m rename to src/ext/matlabbatch/@cfg_mchoice/subsasgn_check.m diff --git a/src/matlabbatch/@cfg_mchoice/subsasgn_job.m b/src/ext/matlabbatch/@cfg_mchoice/subsasgn_job.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/subsasgn_job.m rename to src/ext/matlabbatch/@cfg_mchoice/subsasgn_job.m diff --git a/src/matlabbatch/@cfg_mchoice/subsref.m b/src/ext/matlabbatch/@cfg_mchoice/subsref.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/subsref.m rename to src/ext/matlabbatch/@cfg_mchoice/subsref.m diff --git a/src/matlabbatch/@cfg_mchoice/subsref_job.m b/src/ext/matlabbatch/@cfg_mchoice/subsref_job.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/subsref_job.m rename to src/ext/matlabbatch/@cfg_mchoice/subsref_job.m diff --git a/src/matlabbatch/@cfg_mchoice/tag2cfgsubs.m b/src/ext/matlabbatch/@cfg_mchoice/tag2cfgsubs.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/tag2cfgsubs.m rename to src/ext/matlabbatch/@cfg_mchoice/tag2cfgsubs.m diff --git a/src/matlabbatch/@cfg_mchoice/tagnames.m b/src/ext/matlabbatch/@cfg_mchoice/tagnames.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/tagnames.m rename to src/ext/matlabbatch/@cfg_mchoice/tagnames.m diff --git a/src/matlabbatch/@cfg_mchoice/treepart.m b/src/ext/matlabbatch/@cfg_mchoice/treepart.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/treepart.m rename to src/ext/matlabbatch/@cfg_mchoice/treepart.m diff --git a/src/matlabbatch/@cfg_mchoice/update_deps.m b/src/ext/matlabbatch/@cfg_mchoice/update_deps.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/update_deps.m rename to src/ext/matlabbatch/@cfg_mchoice/update_deps.m diff --git a/src/matlabbatch/@cfg_mchoice/val2def.m b/src/ext/matlabbatch/@cfg_mchoice/val2def.m similarity index 100% rename from src/matlabbatch/@cfg_mchoice/val2def.m rename to src/ext/matlabbatch/@cfg_mchoice/val2def.m diff --git a/src/matlabbatch/@cfg_menu/cfg2struct.m b/src/ext/matlabbatch/@cfg_menu/cfg2struct.m similarity index 100% rename from src/matlabbatch/@cfg_menu/cfg2struct.m rename to src/ext/matlabbatch/@cfg_menu/cfg2struct.m diff --git a/src/matlabbatch/@cfg_menu/cfg_menu.m b/src/ext/matlabbatch/@cfg_menu/cfg_menu.m similarity index 100% rename from src/matlabbatch/@cfg_menu/cfg_menu.m rename to src/ext/matlabbatch/@cfg_menu/cfg_menu.m diff --git a/src/matlabbatch/@cfg_menu/fieldnames.m b/src/ext/matlabbatch/@cfg_menu/fieldnames.m similarity index 100% rename from src/matlabbatch/@cfg_menu/fieldnames.m rename to src/ext/matlabbatch/@cfg_menu/fieldnames.m diff --git a/src/matlabbatch/@cfg_menu/gencode_item.m b/src/ext/matlabbatch/@cfg_menu/gencode_item.m similarity index 100% rename from src/matlabbatch/@cfg_menu/gencode_item.m rename to src/ext/matlabbatch/@cfg_menu/gencode_item.m diff --git a/src/matlabbatch/@cfg_menu/private/mysubs_fields.m b/src/ext/matlabbatch/@cfg_menu/private/mysubs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_menu/private/mysubs_fields.m rename to src/ext/matlabbatch/@cfg_menu/private/mysubs_fields.m diff --git a/src/matlabbatch/@cfg_menu/setval.m b/src/ext/matlabbatch/@cfg_menu/setval.m similarity index 100% rename from src/matlabbatch/@cfg_menu/setval.m rename to src/ext/matlabbatch/@cfg_menu/setval.m diff --git a/src/matlabbatch/@cfg_menu/showdetail.m b/src/ext/matlabbatch/@cfg_menu/showdetail.m similarity index 100% rename from src/matlabbatch/@cfg_menu/showdetail.m rename to src/ext/matlabbatch/@cfg_menu/showdetail.m diff --git a/src/matlabbatch/@cfg_menu/showdoc.m b/src/ext/matlabbatch/@cfg_menu/showdoc.m similarity index 100% rename from src/matlabbatch/@cfg_menu/showdoc.m rename to src/ext/matlabbatch/@cfg_menu/showdoc.m diff --git a/src/matlabbatch/@cfg_menu/subs_fields.m b/src/ext/matlabbatch/@cfg_menu/subs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_menu/subs_fields.m rename to src/ext/matlabbatch/@cfg_menu/subs_fields.m diff --git a/src/matlabbatch/@cfg_menu/subsasgn.m b/src/ext/matlabbatch/@cfg_menu/subsasgn.m similarity index 100% rename from src/matlabbatch/@cfg_menu/subsasgn.m rename to src/ext/matlabbatch/@cfg_menu/subsasgn.m diff --git a/src/matlabbatch/@cfg_menu/subsasgn_check.m b/src/ext/matlabbatch/@cfg_menu/subsasgn_check.m similarity index 100% rename from src/matlabbatch/@cfg_menu/subsasgn_check.m rename to src/ext/matlabbatch/@cfg_menu/subsasgn_check.m diff --git a/src/matlabbatch/@cfg_menu/subsref.m b/src/ext/matlabbatch/@cfg_menu/subsref.m similarity index 100% rename from src/matlabbatch/@cfg_menu/subsref.m rename to src/ext/matlabbatch/@cfg_menu/subsref.m diff --git a/src/matlabbatch/@cfg_repeat/all_leafs.m b/src/ext/matlabbatch/@cfg_repeat/all_leafs.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/all_leafs.m rename to src/ext/matlabbatch/@cfg_repeat/all_leafs.m diff --git a/src/matlabbatch/@cfg_repeat/all_set.m b/src/ext/matlabbatch/@cfg_repeat/all_set.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/all_set.m rename to src/ext/matlabbatch/@cfg_repeat/all_set.m diff --git a/src/matlabbatch/@cfg_repeat/all_set_item.m b/src/ext/matlabbatch/@cfg_repeat/all_set_item.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/all_set_item.m rename to src/ext/matlabbatch/@cfg_repeat/all_set_item.m diff --git a/src/matlabbatch/@cfg_repeat/cfg2jobsubs.m b/src/ext/matlabbatch/@cfg_repeat/cfg2jobsubs.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/cfg2jobsubs.m rename to src/ext/matlabbatch/@cfg_repeat/cfg2jobsubs.m diff --git a/src/matlabbatch/@cfg_repeat/cfg2struct.m b/src/ext/matlabbatch/@cfg_repeat/cfg2struct.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/cfg2struct.m rename to src/ext/matlabbatch/@cfg_repeat/cfg2struct.m diff --git a/src/matlabbatch/@cfg_repeat/cfg_repeat.m b/src/ext/matlabbatch/@cfg_repeat/cfg_repeat.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/cfg_repeat.m rename to src/ext/matlabbatch/@cfg_repeat/cfg_repeat.m diff --git a/src/matlabbatch/@cfg_repeat/checksubs_job.m b/src/ext/matlabbatch/@cfg_repeat/checksubs_job.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/checksubs_job.m rename to src/ext/matlabbatch/@cfg_repeat/checksubs_job.m diff --git a/src/matlabbatch/@cfg_repeat/clearval.m b/src/ext/matlabbatch/@cfg_repeat/clearval.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/clearval.m rename to src/ext/matlabbatch/@cfg_repeat/clearval.m diff --git a/src/matlabbatch/@cfg_repeat/expand.m b/src/ext/matlabbatch/@cfg_repeat/expand.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/expand.m rename to src/ext/matlabbatch/@cfg_repeat/expand.m diff --git a/src/matlabbatch/@cfg_repeat/fieldnames.m b/src/ext/matlabbatch/@cfg_repeat/fieldnames.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/fieldnames.m rename to src/ext/matlabbatch/@cfg_repeat/fieldnames.m diff --git a/src/matlabbatch/@cfg_repeat/fillvals.m b/src/ext/matlabbatch/@cfg_repeat/fillvals.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/fillvals.m rename to src/ext/matlabbatch/@cfg_repeat/fillvals.m diff --git a/src/matlabbatch/@cfg_repeat/gencode_item.m b/src/ext/matlabbatch/@cfg_repeat/gencode_item.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/gencode_item.m rename to src/ext/matlabbatch/@cfg_repeat/gencode_item.m diff --git a/src/matlabbatch/@cfg_repeat/gettag.m b/src/ext/matlabbatch/@cfg_repeat/gettag.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/gettag.m rename to src/ext/matlabbatch/@cfg_repeat/gettag.m diff --git a/src/matlabbatch/@cfg_repeat/harvest.m b/src/ext/matlabbatch/@cfg_repeat/harvest.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/harvest.m rename to src/ext/matlabbatch/@cfg_repeat/harvest.m diff --git a/src/matlabbatch/@cfg_repeat/initialise.m b/src/ext/matlabbatch/@cfg_repeat/initialise.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/initialise.m rename to src/ext/matlabbatch/@cfg_repeat/initialise.m diff --git a/src/matlabbatch/@cfg_repeat/list.m b/src/ext/matlabbatch/@cfg_repeat/list.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/list.m rename to src/ext/matlabbatch/@cfg_repeat/list.m diff --git a/src/matlabbatch/@cfg_repeat/private/mysubs_fields.m b/src/ext/matlabbatch/@cfg_repeat/private/mysubs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/private/mysubs_fields.m rename to src/ext/matlabbatch/@cfg_repeat/private/mysubs_fields.m diff --git a/src/matlabbatch/@cfg_repeat/setval.m b/src/ext/matlabbatch/@cfg_repeat/setval.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/setval.m rename to src/ext/matlabbatch/@cfg_repeat/setval.m diff --git a/src/matlabbatch/@cfg_repeat/showdetail.m b/src/ext/matlabbatch/@cfg_repeat/showdetail.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/showdetail.m rename to src/ext/matlabbatch/@cfg_repeat/showdetail.m diff --git a/src/matlabbatch/@cfg_repeat/showdoc.m b/src/ext/matlabbatch/@cfg_repeat/showdoc.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/showdoc.m rename to src/ext/matlabbatch/@cfg_repeat/showdoc.m diff --git a/src/matlabbatch/@cfg_repeat/showmydoc.m b/src/ext/matlabbatch/@cfg_repeat/showmydoc.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/showmydoc.m rename to src/ext/matlabbatch/@cfg_repeat/showmydoc.m diff --git a/src/matlabbatch/@cfg_repeat/subs_fields.m b/src/ext/matlabbatch/@cfg_repeat/subs_fields.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/subs_fields.m rename to src/ext/matlabbatch/@cfg_repeat/subs_fields.m diff --git a/src/matlabbatch/@cfg_repeat/subsasgn.m b/src/ext/matlabbatch/@cfg_repeat/subsasgn.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/subsasgn.m rename to src/ext/matlabbatch/@cfg_repeat/subsasgn.m diff --git a/src/matlabbatch/@cfg_repeat/subsasgn_check.m b/src/ext/matlabbatch/@cfg_repeat/subsasgn_check.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/subsasgn_check.m rename to src/ext/matlabbatch/@cfg_repeat/subsasgn_check.m diff --git a/src/matlabbatch/@cfg_repeat/subsasgn_job.m b/src/ext/matlabbatch/@cfg_repeat/subsasgn_job.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/subsasgn_job.m rename to src/ext/matlabbatch/@cfg_repeat/subsasgn_job.m diff --git a/src/matlabbatch/@cfg_repeat/subsref.m b/src/ext/matlabbatch/@cfg_repeat/subsref.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/subsref.m rename to src/ext/matlabbatch/@cfg_repeat/subsref.m diff --git a/src/matlabbatch/@cfg_repeat/subsref_job.m b/src/ext/matlabbatch/@cfg_repeat/subsref_job.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/subsref_job.m rename to src/ext/matlabbatch/@cfg_repeat/subsref_job.m diff --git a/src/matlabbatch/@cfg_repeat/tag2cfgsubs.m b/src/ext/matlabbatch/@cfg_repeat/tag2cfgsubs.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/tag2cfgsubs.m rename to src/ext/matlabbatch/@cfg_repeat/tag2cfgsubs.m diff --git a/src/matlabbatch/@cfg_repeat/tagnames.m b/src/ext/matlabbatch/@cfg_repeat/tagnames.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/tagnames.m rename to src/ext/matlabbatch/@cfg_repeat/tagnames.m diff --git a/src/matlabbatch/@cfg_repeat/treepart.m b/src/ext/matlabbatch/@cfg_repeat/treepart.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/treepart.m rename to src/ext/matlabbatch/@cfg_repeat/treepart.m diff --git a/src/matlabbatch/@cfg_repeat/update_deps.m b/src/ext/matlabbatch/@cfg_repeat/update_deps.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/update_deps.m rename to src/ext/matlabbatch/@cfg_repeat/update_deps.m diff --git a/src/matlabbatch/@cfg_repeat/val2def.m b/src/ext/matlabbatch/@cfg_repeat/val2def.m similarity index 100% rename from src/matlabbatch/@cfg_repeat/val2def.m rename to src/ext/matlabbatch/@cfg_repeat/val2def.m diff --git a/src/matlabbatch/bin/cpcode.sh b/src/ext/matlabbatch/bin/cpcode.sh similarity index 100% rename from src/matlabbatch/bin/cpcode.sh rename to src/ext/matlabbatch/bin/cpcode.sh diff --git a/src/matlabbatch/bin/resave_cfg_ui.sh b/src/ext/matlabbatch/bin/resave_cfg_ui.sh similarity index 100% rename from src/matlabbatch/bin/resave_cfg_ui.sh rename to src/ext/matlabbatch/bin/resave_cfg_ui.sh diff --git a/src/matlabbatch/cfg_basicio/cfg_basicio_rewrite.m b/src/ext/matlabbatch/cfg_basicio/cfg_basicio_rewrite.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_basicio_rewrite.m rename to src/ext/matlabbatch/cfg_basicio/cfg_basicio_rewrite.m diff --git a/src/matlabbatch/cfg_basicio/cfg_cfg_basicio.m b/src/ext/matlabbatch/cfg_basicio/cfg_cfg_basicio.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_cfg_basicio.m rename to src/ext/matlabbatch/cfg_basicio/cfg_cfg_basicio.m diff --git a/src/matlabbatch/cfg_basicio/cfg_cfg_basicio_def.m b/src/ext/matlabbatch/cfg_basicio/cfg_cfg_basicio_def.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_cfg_basicio_def.m rename to src/ext/matlabbatch/cfg_basicio/cfg_cfg_basicio_def.m diff --git a/src/matlabbatch/cfg_basicio/cfg_check_assignin.m b/src/ext/matlabbatch/cfg_basicio/cfg_check_assignin.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_check_assignin.m rename to src/ext/matlabbatch/cfg_basicio/cfg_check_assignin.m diff --git a/src/matlabbatch/cfg_basicio/cfg_load_vars.m b/src/ext/matlabbatch/cfg_basicio/cfg_load_vars.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_load_vars.m rename to src/ext/matlabbatch/cfg_basicio/cfg_load_vars.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_assignin.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_assignin.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_assignin.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_assignin.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_call_matlab.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_call_matlab.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_call_matlab.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_call_matlab.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_cd.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_cd.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_cd.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_cd.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_file_filter.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_file_filter.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_file_filter.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_file_filter.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_file_fplist.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_file_fplist.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_file_fplist.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_file_fplist.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_file_move.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_file_move.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_file_move.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_file_move.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_file_split.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_file_split.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_file_split.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_file_split.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_fileparts.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_fileparts.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_fileparts.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_fileparts.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_gunzip_files.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_gunzip_files.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_gunzip_files.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_gunzip_files.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_gzip_files.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_gzip_files.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_gzip_files.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_gzip_files.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_mkdir.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_mkdir.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_mkdir.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_mkdir.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_named_dir.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_named_dir.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_named_dir.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_named_dir.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_named_file.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_named_file.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_named_file.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_named_file.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_named_input.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_named_input.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_named_input.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_named_input.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_runjobs.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_runjobs.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_runjobs.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_runjobs.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_save_vars.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_save_vars.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_save_vars.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_save_vars.m diff --git a/src/matlabbatch/cfg_basicio/cfg_run_subsrefvar.m b/src/ext/matlabbatch/cfg_basicio/cfg_run_subsrefvar.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_run_subsrefvar.m rename to src/ext/matlabbatch/cfg_basicio/cfg_run_subsrefvar.m diff --git a/src/matlabbatch/cfg_basicio/cfg_vout_file_filter.m b/src/ext/matlabbatch/cfg_basicio/cfg_vout_file_filter.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_vout_file_filter.m rename to src/ext/matlabbatch/cfg_basicio/cfg_vout_file_filter.m diff --git a/src/matlabbatch/cfg_basicio/cfg_vout_file_fplist.m b/src/ext/matlabbatch/cfg_basicio/cfg_vout_file_fplist.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_vout_file_fplist.m rename to src/ext/matlabbatch/cfg_basicio/cfg_vout_file_fplist.m diff --git a/src/matlabbatch/cfg_basicio/cfg_vout_file_move.m b/src/ext/matlabbatch/cfg_basicio/cfg_vout_file_move.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_vout_file_move.m rename to src/ext/matlabbatch/cfg_basicio/cfg_vout_file_move.m diff --git a/src/matlabbatch/cfg_basicio/cfg_vout_file_split.m b/src/ext/matlabbatch/cfg_basicio/cfg_vout_file_split.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_vout_file_split.m rename to src/ext/matlabbatch/cfg_basicio/cfg_vout_file_split.m diff --git a/src/matlabbatch/cfg_basicio/cfg_vout_fileparts.m b/src/ext/matlabbatch/cfg_basicio/cfg_vout_fileparts.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_vout_fileparts.m rename to src/ext/matlabbatch/cfg_basicio/cfg_vout_fileparts.m diff --git a/src/matlabbatch/cfg_basicio/cfg_vout_gunzip_files.m b/src/ext/matlabbatch/cfg_basicio/cfg_vout_gunzip_files.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_vout_gunzip_files.m rename to src/ext/matlabbatch/cfg_basicio/cfg_vout_gunzip_files.m diff --git a/src/matlabbatch/cfg_basicio/cfg_vout_gzip_files.m b/src/ext/matlabbatch/cfg_basicio/cfg_vout_gzip_files.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_vout_gzip_files.m rename to src/ext/matlabbatch/cfg_basicio/cfg_vout_gzip_files.m diff --git a/src/matlabbatch/cfg_basicio/cfg_vout_mkdir.m b/src/ext/matlabbatch/cfg_basicio/cfg_vout_mkdir.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_vout_mkdir.m rename to src/ext/matlabbatch/cfg_basicio/cfg_vout_mkdir.m diff --git a/src/matlabbatch/cfg_basicio/cfg_vout_named_dir.m b/src/ext/matlabbatch/cfg_basicio/cfg_vout_named_dir.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_vout_named_dir.m rename to src/ext/matlabbatch/cfg_basicio/cfg_vout_named_dir.m diff --git a/src/matlabbatch/cfg_basicio/cfg_vout_named_file.m b/src/ext/matlabbatch/cfg_basicio/cfg_vout_named_file.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_vout_named_file.m rename to src/ext/matlabbatch/cfg_basicio/cfg_vout_named_file.m diff --git a/src/matlabbatch/cfg_basicio/cfg_vout_named_input.m b/src/ext/matlabbatch/cfg_basicio/cfg_vout_named_input.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_vout_named_input.m rename to src/ext/matlabbatch/cfg_basicio/cfg_vout_named_input.m diff --git a/src/matlabbatch/cfg_basicio/cfg_vout_runjobs.m b/src/ext/matlabbatch/cfg_basicio/cfg_vout_runjobs.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_vout_runjobs.m rename to src/ext/matlabbatch/cfg_basicio/cfg_vout_runjobs.m diff --git a/src/matlabbatch/cfg_basicio/cfg_vout_save_vars.m b/src/ext/matlabbatch/cfg_basicio/cfg_vout_save_vars.m similarity index 100% rename from src/matlabbatch/cfg_basicio/cfg_vout_save_vars.m rename to src/ext/matlabbatch/cfg_basicio/cfg_vout_save_vars.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_02_cd.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_02_cd.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_02_cd.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_02_cd.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_03_mkdir.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_03_mkdir.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_03_mkdir.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_03_mkdir.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_04_named_dir.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_04_named_dir.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_04_named_dir.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_04_named_dir.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_toplevel.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_toplevel.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_toplevel.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/01_dir_ops/batch_basicio_toplevel.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_01_file_move.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_01_file_move.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_01_file_move.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_01_file_move.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_02_gzip_files.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_02_gzip_files.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_02_gzip_files.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_02_gzip_files.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_03_gunzip_files.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_03_gunzip_files.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_03_gunzip_files.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_03_gunzip_files.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_05_named_file.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_05_named_file.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_05_named_file.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_05_named_file.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_06_file_fplist.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_06_file_fplist.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_06_file_fplist.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_06_file_fplist.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_07_file_filter.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_07_file_filter.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_07_file_filter.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_07_file_filter.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_09_file_split.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_09_file_split.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_09_file_split.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_09_file_split.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_toplevel.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_toplevel.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_toplevel.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/02_file_ops/batch_basicio_toplevel.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/batch_basicio_08_fileparts.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/batch_basicio_08_fileparts.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/batch_basicio_08_fileparts.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/batch_basicio_08_fileparts.m diff --git a/src/matlabbatch/cfg_basicio/src/01_file_dir_ops/batch_basicio_toplevel.m b/src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/batch_basicio_toplevel.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/01_file_dir_ops/batch_basicio_toplevel.m rename to src/ext/matlabbatch/cfg_basicio/src/01_file_dir_ops/batch_basicio_toplevel.m diff --git a/src/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_10_named_input.m b/src/ext/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_10_named_input.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_10_named_input.m rename to src/ext/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_10_named_input.m diff --git a/src/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_11_load_vars.m b/src/ext/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_11_load_vars.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_11_load_vars.m rename to src/ext/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_11_load_vars.m diff --git a/src/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_12_save_vars.m b/src/ext/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_12_save_vars.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_12_save_vars.m rename to src/ext/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_12_save_vars.m diff --git a/src/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_13_subsrefvar.m b/src/ext/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_13_subsrefvar.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_13_subsrefvar.m rename to src/ext/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_13_subsrefvar.m diff --git a/src/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_14_assignin.m b/src/ext/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_14_assignin.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_14_assignin.m rename to src/ext/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_14_assignin.m diff --git a/src/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_toplevel.m b/src/ext/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_toplevel.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_toplevel.m rename to src/ext/matlabbatch/cfg_basicio/src/02_var_ops/batch_basicio_toplevel.m diff --git a/src/matlabbatch/cfg_basicio/src/03_run_ops/batch_basicio_15_runjobs.m b/src/ext/matlabbatch/cfg_basicio/src/03_run_ops/batch_basicio_15_runjobs.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/03_run_ops/batch_basicio_15_runjobs.m rename to src/ext/matlabbatch/cfg_basicio/src/03_run_ops/batch_basicio_15_runjobs.m diff --git a/src/matlabbatch/cfg_basicio/src/03_run_ops/batch_basicio_16_call_matlab.m b/src/ext/matlabbatch/cfg_basicio/src/03_run_ops/batch_basicio_16_call_matlab.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/03_run_ops/batch_basicio_16_call_matlab.m rename to src/ext/matlabbatch/cfg_basicio/src/03_run_ops/batch_basicio_16_call_matlab.m diff --git a/src/matlabbatch/cfg_basicio/src/03_run_ops/batch_basicio_toplevel.m b/src/ext/matlabbatch/cfg_basicio/src/03_run_ops/batch_basicio_toplevel.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/03_run_ops/batch_basicio_toplevel.m rename to src/ext/matlabbatch/cfg_basicio/src/03_run_ops/batch_basicio_toplevel.m diff --git a/src/matlabbatch/cfg_basicio/src/batch_basicio_codegen.m b/src/ext/matlabbatch/cfg_basicio/src/batch_basicio_codegen.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/batch_basicio_codegen.m rename to src/ext/matlabbatch/cfg_basicio/src/batch_basicio_codegen.m diff --git a/src/matlabbatch/cfg_basicio/src/batch_basicio_toplevel.m b/src/ext/matlabbatch/cfg_basicio/src/batch_basicio_toplevel.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/batch_basicio_toplevel.m rename to src/ext/matlabbatch/cfg_basicio/src/batch_basicio_toplevel.m diff --git a/src/matlabbatch/cfg_basicio/src/create_cfg_cfg_basicio.m b/src/ext/matlabbatch/cfg_basicio/src/create_cfg_cfg_basicio.m similarity index 100% rename from src/matlabbatch/cfg_basicio/src/create_cfg_cfg_basicio.m rename to src/ext/matlabbatch/cfg_basicio/src/create_cfg_cfg_basicio.m diff --git a/src/matlabbatch/cfg_callbuiltin.m b/src/ext/matlabbatch/cfg_callbuiltin.m similarity index 100% rename from src/matlabbatch/cfg_callbuiltin.m rename to src/ext/matlabbatch/cfg_callbuiltin.m diff --git a/src/matlabbatch/cfg_confgui/cfg_confgui.m b/src/ext/matlabbatch/cfg_confgui/cfg_confgui.m similarity index 100% rename from src/matlabbatch/cfg_confgui/cfg_confgui.m rename to src/ext/matlabbatch/cfg_confgui/cfg_confgui.m diff --git a/src/matlabbatch/cfg_confgui/cfg_run_template.m b/src/ext/matlabbatch/cfg_confgui/cfg_run_template.m similarity index 100% rename from src/matlabbatch/cfg_confgui/cfg_run_template.m rename to src/ext/matlabbatch/cfg_confgui/cfg_run_template.m diff --git a/src/matlabbatch/cfg_conftest.m b/src/ext/matlabbatch/cfg_conftest.m similarity index 100% rename from src/matlabbatch/cfg_conftest.m rename to src/ext/matlabbatch/cfg_conftest.m diff --git a/src/matlabbatch/cfg_dbstop.m b/src/ext/matlabbatch/cfg_dbstop.m similarity index 100% rename from src/matlabbatch/cfg_dbstop.m rename to src/ext/matlabbatch/cfg_dbstop.m diff --git a/src/matlabbatch/cfg_findspec.m b/src/ext/matlabbatch/cfg_findspec.m similarity index 100% rename from src/matlabbatch/cfg_findspec.m rename to src/ext/matlabbatch/cfg_findspec.m diff --git a/src/matlabbatch/cfg_get_defaults.m b/src/ext/matlabbatch/cfg_get_defaults.m similarity index 100% rename from src/matlabbatch/cfg_get_defaults.m rename to src/ext/matlabbatch/cfg_get_defaults.m diff --git a/src/matlabbatch/cfg_getfile.m b/src/ext/matlabbatch/cfg_getfile.m similarity index 100% rename from src/matlabbatch/cfg_getfile.m rename to src/ext/matlabbatch/cfg_getfile.m diff --git a/src/matlabbatch/cfg_job.m b/src/ext/matlabbatch/cfg_job.m similarity index 100% rename from src/matlabbatch/cfg_job.m rename to src/ext/matlabbatch/cfg_job.m diff --git a/src/matlabbatch/cfg_load_jobs.m b/src/ext/matlabbatch/cfg_load_jobs.m similarity index 100% rename from src/matlabbatch/cfg_load_jobs.m rename to src/ext/matlabbatch/cfg_load_jobs.m diff --git a/src/matlabbatch/cfg_message.m b/src/ext/matlabbatch/cfg_message.m similarity index 100% rename from src/matlabbatch/cfg_message.m rename to src/ext/matlabbatch/cfg_message.m diff --git a/src/matlabbatch/cfg_mlbatch_appcfg.m b/src/ext/matlabbatch/cfg_mlbatch_appcfg.m similarity index 100% rename from src/matlabbatch/cfg_mlbatch_appcfg.m rename to src/ext/matlabbatch/cfg_mlbatch_appcfg.m diff --git a/src/matlabbatch/cfg_serial.m b/src/ext/matlabbatch/cfg_serial.m similarity index 100% rename from src/matlabbatch/cfg_serial.m rename to src/ext/matlabbatch/cfg_serial.m diff --git a/src/matlabbatch/cfg_struct2cfg.m b/src/ext/matlabbatch/cfg_struct2cfg.m similarity index 100% rename from src/matlabbatch/cfg_struct2cfg.m rename to src/ext/matlabbatch/cfg_struct2cfg.m diff --git a/src/matlabbatch/cfg_tropts.m b/src/ext/matlabbatch/cfg_tropts.m similarity index 100% rename from src/matlabbatch/cfg_tropts.m rename to src/ext/matlabbatch/cfg_tropts.m diff --git a/src/matlabbatch/cfg_txtdesc2cfg.m b/src/ext/matlabbatch/cfg_txtdesc2cfg.m similarity index 100% rename from src/matlabbatch/cfg_txtdesc2cfg.m rename to src/ext/matlabbatch/cfg_txtdesc2cfg.m diff --git a/src/matlabbatch/cfg_ui.fig b/src/ext/matlabbatch/cfg_ui.fig similarity index 100% rename from src/matlabbatch/cfg_ui.fig rename to src/ext/matlabbatch/cfg_ui.fig diff --git a/src/matlabbatch/cfg_ui.m b/src/ext/matlabbatch/cfg_ui.m similarity index 100% rename from src/matlabbatch/cfg_ui.m rename to src/ext/matlabbatch/cfg_ui.m diff --git a/src/matlabbatch/cfg_ui_multibatch.fig b/src/ext/matlabbatch/cfg_ui_multibatch.fig similarity index 100% rename from src/matlabbatch/cfg_ui_multibatch.fig rename to src/ext/matlabbatch/cfg_ui_multibatch.fig diff --git a/src/matlabbatch/cfg_ui_multibatch.m b/src/ext/matlabbatch/cfg_ui_multibatch.m similarity index 100% rename from src/matlabbatch/cfg_ui_multibatch.m rename to src/ext/matlabbatch/cfg_ui_multibatch.m diff --git a/src/matlabbatch/cfg_ui_util.m b/src/ext/matlabbatch/cfg_ui_util.m similarity index 100% rename from src/matlabbatch/cfg_ui_util.m rename to src/ext/matlabbatch/cfg_ui_util.m diff --git a/src/matlabbatch/cfg_util.m b/src/ext/matlabbatch/cfg_util.m similarity index 100% rename from src/matlabbatch/cfg_util.m rename to src/ext/matlabbatch/cfg_util.m diff --git a/src/matlabbatch/examples/batch_example_add1.m b/src/ext/matlabbatch/examples/batch_example_add1.m similarity index 100% rename from src/matlabbatch/examples/batch_example_add1.m rename to src/ext/matlabbatch/examples/batch_example_add1.m diff --git a/src/matlabbatch/examples/batch_example_add1_div.m b/src/ext/matlabbatch/examples/batch_example_add1_div.m similarity index 100% rename from src/matlabbatch/examples/batch_example_add1_div.m rename to src/ext/matlabbatch/examples/batch_example_add1_div.m diff --git a/src/matlabbatch/examples/batch_example_add1_div_reuse_b.m b/src/ext/matlabbatch/examples/batch_example_add1_div_reuse_b.m similarity index 100% rename from src/matlabbatch/examples/batch_example_add1_div_reuse_b.m rename to src/ext/matlabbatch/examples/batch_example_add1_div_reuse_b.m diff --git a/src/matlabbatch/examples/batch_example_add1_div_reuse_b_outname.m b/src/ext/matlabbatch/examples/batch_example_add1_div_reuse_b_outname.m similarity index 100% rename from src/matlabbatch/examples/batch_example_add1_div_reuse_b_outname.m rename to src/ext/matlabbatch/examples/batch_example_add1_div_reuse_b_outname.m diff --git a/src/matlabbatch/examples/cfg_example_add1.m b/src/ext/matlabbatch/examples/cfg_example_add1.m similarity index 100% rename from src/matlabbatch/examples/cfg_example_add1.m rename to src/ext/matlabbatch/examples/cfg_example_add1.m diff --git a/src/matlabbatch/examples/cfg_example_add2.m b/src/ext/matlabbatch/examples/cfg_example_add2.m similarity index 100% rename from src/matlabbatch/examples/cfg_example_add2.m rename to src/ext/matlabbatch/examples/cfg_example_add2.m diff --git a/src/matlabbatch/examples/cfg_example_cumsum1.m b/src/ext/matlabbatch/examples/cfg_example_cumsum1.m similarity index 100% rename from src/matlabbatch/examples/cfg_example_cumsum1.m rename to src/ext/matlabbatch/examples/cfg_example_cumsum1.m diff --git a/src/matlabbatch/examples/cfg_example_cumsum2.m b/src/ext/matlabbatch/examples/cfg_example_cumsum2.m similarity index 100% rename from src/matlabbatch/examples/cfg_example_cumsum2.m rename to src/ext/matlabbatch/examples/cfg_example_cumsum2.m diff --git a/src/matlabbatch/examples/cfg_example_div.m b/src/ext/matlabbatch/examples/cfg_example_div.m similarity index 100% rename from src/matlabbatch/examples/cfg_example_div.m rename to src/ext/matlabbatch/examples/cfg_example_div.m diff --git a/src/matlabbatch/examples/cfg_example_master.m b/src/ext/matlabbatch/examples/cfg_example_master.m similarity index 100% rename from src/matlabbatch/examples/cfg_example_master.m rename to src/ext/matlabbatch/examples/cfg_example_master.m diff --git a/src/matlabbatch/examples/cfg_example_run_add1.m b/src/ext/matlabbatch/examples/cfg_example_run_add1.m similarity index 100% rename from src/matlabbatch/examples/cfg_example_run_add1.m rename to src/ext/matlabbatch/examples/cfg_example_run_add1.m diff --git a/src/matlabbatch/examples/cfg_example_run_add2.m b/src/ext/matlabbatch/examples/cfg_example_run_add2.m similarity index 100% rename from src/matlabbatch/examples/cfg_example_run_add2.m rename to src/ext/matlabbatch/examples/cfg_example_run_add2.m diff --git a/src/matlabbatch/examples/cfg_example_run_cumsum1.m b/src/ext/matlabbatch/examples/cfg_example_run_cumsum1.m similarity index 100% rename from src/matlabbatch/examples/cfg_example_run_cumsum1.m rename to src/ext/matlabbatch/examples/cfg_example_run_cumsum1.m diff --git a/src/matlabbatch/examples/cfg_example_run_cumsum2.m b/src/ext/matlabbatch/examples/cfg_example_run_cumsum2.m similarity index 100% rename from src/matlabbatch/examples/cfg_example_run_cumsum2.m rename to src/ext/matlabbatch/examples/cfg_example_run_cumsum2.m diff --git a/src/matlabbatch/examples/cfg_example_run_div.m b/src/ext/matlabbatch/examples/cfg_example_run_div.m similarity index 100% rename from src/matlabbatch/examples/cfg_example_run_div.m rename to src/ext/matlabbatch/examples/cfg_example_run_div.m diff --git a/src/matlabbatch/examples/cfg_example_run_sum.m b/src/ext/matlabbatch/examples/cfg_example_run_sum.m similarity index 100% rename from src/matlabbatch/examples/cfg_example_run_sum.m rename to src/ext/matlabbatch/examples/cfg_example_run_sum.m diff --git a/src/matlabbatch/examples/cfg_example_sum.m b/src/ext/matlabbatch/examples/cfg_example_sum.m similarity index 100% rename from src/matlabbatch/examples/cfg_example_sum.m rename to src/ext/matlabbatch/examples/cfg_example_sum.m diff --git a/src/matlabbatch/examples/cfg_mlbatch_appcfg.m.example b/src/ext/matlabbatch/examples/cfg_mlbatch_appcfg.m.example similarity index 100% rename from src/matlabbatch/examples/cfg_mlbatch_appcfg.m.example rename to src/ext/matlabbatch/examples/cfg_mlbatch_appcfg.m.example diff --git a/src/matlabbatch/examples/toy_example.m b/src/ext/matlabbatch/examples/toy_example.m similarity index 100% rename from src/matlabbatch/examples/toy_example.m rename to src/ext/matlabbatch/examples/toy_example.m diff --git a/src/matlabbatch/gencode.m b/src/ext/matlabbatch/gencode.m similarity index 100% rename from src/matlabbatch/gencode.m rename to src/ext/matlabbatch/gencode.m diff --git a/src/matlabbatch/gencode_rvalue.m b/src/ext/matlabbatch/gencode_rvalue.m similarity index 100% rename from src/matlabbatch/gencode_rvalue.m rename to src/ext/matlabbatch/gencode_rvalue.m diff --git a/src/matlabbatch/gencode_substruct.m b/src/ext/matlabbatch/gencode_substruct.m similarity index 100% rename from src/matlabbatch/gencode_substruct.m rename to src/ext/matlabbatch/gencode_substruct.m diff --git a/src/matlabbatch/gencode_substructcode.m b/src/ext/matlabbatch/gencode_substructcode.m similarity index 100% rename from src/matlabbatch/gencode_substructcode.m rename to src/ext/matlabbatch/gencode_substructcode.m diff --git a/src/matlabbatch/help2cell.m b/src/ext/matlabbatch/help2cell.m similarity index 100% rename from src/matlabbatch/help2cell.m rename to src/ext/matlabbatch/help2cell.m diff --git a/src/matlabbatch/hgsave_pre2008a.m b/src/ext/matlabbatch/hgsave_pre2008a.m similarity index 100% rename from src/matlabbatch/hgsave_pre2008a.m rename to src/ext/matlabbatch/hgsave_pre2008a.m diff --git a/src/matlabbatch/matlabbatch.man b/src/ext/matlabbatch/matlabbatch.man similarity index 100% rename from src/matlabbatch/matlabbatch.man rename to src/ext/matlabbatch/matlabbatch.man diff --git a/src/matlabbatch/private/README.inputdlg.txt b/src/ext/matlabbatch/private/README.inputdlg.txt similarity index 100% rename from src/matlabbatch/private/README.inputdlg.txt rename to src/ext/matlabbatch/private/README.inputdlg.txt diff --git a/src/matlabbatch/private/cfg_disp_error.m b/src/ext/matlabbatch/private/cfg_disp_error.m similarity index 100% rename from src/matlabbatch/private/cfg_disp_error.m rename to src/ext/matlabbatch/private/cfg_disp_error.m diff --git a/src/matlabbatch/private/cfg_eval_valedit.m b/src/ext/matlabbatch/private/cfg_eval_valedit.m similarity index 100% rename from src/matlabbatch/private/cfg_eval_valedit.m rename to src/ext/matlabbatch/private/cfg_eval_valedit.m diff --git a/src/matlabbatch/private/cfg_justify.m b/src/ext/matlabbatch/private/cfg_justify.m similarity index 100% rename from src/matlabbatch/private/cfg_justify.m rename to src/ext/matlabbatch/private/cfg_justify.m diff --git a/src/matlabbatch/private/cfg_maxextent.m b/src/ext/matlabbatch/private/cfg_maxextent.m similarity index 100% rename from src/matlabbatch/private/cfg_maxextent.m rename to src/ext/matlabbatch/private/cfg_maxextent.m diff --git a/src/matlabbatch/private/cfg_mlbatch_defaults.m b/src/ext/matlabbatch/private/cfg_mlbatch_defaults.m similarity index 100% rename from src/matlabbatch/private/cfg_mlbatch_defaults.m rename to src/ext/matlabbatch/private/cfg_mlbatch_defaults.m diff --git a/src/matlabbatch/private/cfg_mlbatch_root.m b/src/ext/matlabbatch/private/cfg_mlbatch_root.m similarity index 100% rename from src/matlabbatch/private/cfg_mlbatch_root.m rename to src/ext/matlabbatch/private/cfg_mlbatch_root.m diff --git a/src/matlabbatch/private/cfg_onscreen.m b/src/ext/matlabbatch/private/cfg_onscreen.m similarity index 100% rename from src/matlabbatch/private/cfg_onscreen.m rename to src/ext/matlabbatch/private/cfg_onscreen.m diff --git a/src/matlabbatch/private/cfg_run_cm.m b/src/ext/matlabbatch/private/cfg_run_cm.m similarity index 100% rename from src/matlabbatch/private/cfg_run_cm.m rename to src/ext/matlabbatch/private/cfg_run_cm.m diff --git a/src/matlabbatch/private/cfg_textfill.m b/src/ext/matlabbatch/private/cfg_textfill.m similarity index 100% rename from src/matlabbatch/private/cfg_textfill.m rename to src/ext/matlabbatch/private/cfg_textfill.m diff --git a/src/matlabbatch/private/cfg_ui_disable.m b/src/ext/matlabbatch/private/cfg_ui_disable.m similarity index 100% rename from src/matlabbatch/private/cfg_ui_disable.m rename to src/ext/matlabbatch/private/cfg_ui_disable.m diff --git a/src/matlabbatch/private/cfg_ui_getListboxTop.m b/src/ext/matlabbatch/private/cfg_ui_getListboxTop.m similarity index 100% rename from src/matlabbatch/private/cfg_ui_getListboxTop.m rename to src/ext/matlabbatch/private/cfg_ui_getListboxTop.m diff --git a/src/matlabbatch/private/cfg_ui_restore.m b/src/ext/matlabbatch/private/cfg_ui_restore.m similarity index 100% rename from src/matlabbatch/private/cfg_ui_restore.m rename to src/ext/matlabbatch/private/cfg_ui_restore.m diff --git a/src/matlabbatch/private/cfg_util_persistent.m b/src/ext/matlabbatch/private/cfg_util_persistent.m similarity index 100% rename from src/matlabbatch/private/cfg_util_persistent.m rename to src/ext/matlabbatch/private/cfg_util_persistent.m diff --git a/src/matlabbatch/private/copyright_cfg.m b/src/ext/matlabbatch/private/copyright_cfg.m similarity index 100% rename from src/matlabbatch/private/copyright_cfg.m rename to src/ext/matlabbatch/private/copyright_cfg.m diff --git a/src/matlabbatch/private/copyright_spm.m b/src/ext/matlabbatch/private/copyright_spm.m similarity index 100% rename from src/matlabbatch/private/copyright_spm.m rename to src/ext/matlabbatch/private/copyright_spm.m diff --git a/src/matlabbatch/private/getnicedialoglocation.m b/src/ext/matlabbatch/private/getnicedialoglocation.m similarity index 100% rename from src/matlabbatch/private/getnicedialoglocation.m rename to src/ext/matlabbatch/private/getnicedialoglocation.m diff --git a/src/matlabbatch/private/inputdlg.m b/src/ext/matlabbatch/private/inputdlg.m similarity index 100% rename from src/matlabbatch/private/inputdlg.m rename to src/ext/matlabbatch/private/inputdlg.m diff --git a/src/matlabbatch/private/int2str.m b/src/ext/matlabbatch/private/int2str.m similarity index 100% rename from src/matlabbatch/private/int2str.m rename to src/ext/matlabbatch/private/int2str.m diff --git a/src/matlabbatch/private/listdlg.m b/src/ext/matlabbatch/private/listdlg.m similarity index 100% rename from src/matlabbatch/private/listdlg.m rename to src/ext/matlabbatch/private/listdlg.m diff --git a/src/matlabbatch/private/num2str.m b/src/ext/matlabbatch/private/num2str.m similarity index 100% rename from src/matlabbatch/private/num2str.m rename to src/ext/matlabbatch/private/num2str.m diff --git a/src/matlabbatch/private/requestJavaAdapter.m b/src/ext/matlabbatch/private/requestJavaAdapter.m similarity index 100% rename from src/matlabbatch/private/requestJavaAdapter.m rename to src/ext/matlabbatch/private/requestJavaAdapter.m diff --git a/src/matlabbatch/private/setdefaultbutton.m b/src/ext/matlabbatch/private/setdefaultbutton.m similarity index 100% rename from src/matlabbatch/private/setdefaultbutton.m rename to src/ext/matlabbatch/private/setdefaultbutton.m diff --git a/src/matlabbatch/subsasgn_check_funhandle.m b/src/ext/matlabbatch/subsasgn_check_funhandle.m similarity index 100% rename from src/matlabbatch/subsasgn_check_funhandle.m rename to src/ext/matlabbatch/subsasgn_check_funhandle.m diff --git a/src/matlabbatch/subsasgn_check_num.m b/src/ext/matlabbatch/subsasgn_check_num.m similarity index 100% rename from src/matlabbatch/subsasgn_check_num.m rename to src/ext/matlabbatch/subsasgn_check_num.m diff --git a/src/matlabbatch/subsasgn_check_valcfg.m b/src/ext/matlabbatch/subsasgn_check_valcfg.m similarity index 100% rename from src/matlabbatch/subsasgn_check_valcfg.m rename to src/ext/matlabbatch/subsasgn_check_valcfg.m diff --git a/src/pupil-size/CHANGES_MADE.md b/src/ext/pupil-size/CHANGES_MADE.md similarity index 100% rename from src/pupil-size/CHANGES_MADE.md rename to src/ext/pupil-size/CHANGES_MADE.md diff --git a/src/pupil-size/LICENSE b/src/ext/pupil-size/LICENSE similarity index 100% rename from src/pupil-size/LICENSE rename to src/ext/pupil-size/LICENSE diff --git a/src/pupil-size/README.md b/src/ext/pupil-size/README.md similarity index 100% rename from src/pupil-size/README.md rename to src/ext/pupil-size/README.md diff --git a/src/pupil-size/code/READ_ME.txt b/src/ext/pupil-size/code/READ_ME.txt similarity index 100% rename from src/pupil-size/code/READ_ME.txt rename to src/ext/pupil-size/code/READ_ME.txt diff --git a/src/pupil-size/code/dataModels/PupilDataModel.m b/src/ext/pupil-size/code/dataModels/PupilDataModel.m similarity index 100% rename from src/pupil-size/code/dataModels/PupilDataModel.m rename to src/ext/pupil-size/code/dataModels/PupilDataModel.m diff --git a/src/pupil-size/code/dataModels/RawSamplesModel.m b/src/ext/pupil-size/code/dataModels/RawSamplesModel.m similarity index 100% rename from src/pupil-size/code/dataModels/RawSamplesModel.m rename to src/ext/pupil-size/code/dataModels/RawSamplesModel.m diff --git a/src/pupil-size/code/dataModels/ValidSamplesModel.m b/src/ext/pupil-size/code/dataModels/ValidSamplesModel.m similarity index 100% rename from src/pupil-size/code/dataModels/ValidSamplesModel.m rename to src/ext/pupil-size/code/dataModels/ValidSamplesModel.m diff --git a/src/pupil-size/code/helperFunctions/LEGACY/array2table.m b/src/ext/pupil-size/code/helperFunctions/LEGACY/array2table.m similarity index 100% rename from src/pupil-size/code/helperFunctions/LEGACY/array2table.m rename to src/ext/pupil-size/code/helperFunctions/LEGACY/array2table.m diff --git a/src/pupil-size/code/helperFunctions/LEGACY/table.m b/src/ext/pupil-size/code/helperFunctions/LEGACY/table.m similarity index 100% rename from src/pupil-size/code/helperFunctions/LEGACY/table.m rename to src/ext/pupil-size/code/helperFunctions/LEGACY/table.m diff --git a/src/pupil-size/code/helperFunctions/genMeanDiaSamples.m b/src/ext/pupil-size/code/helperFunctions/genMeanDiaSamples.m similarity index 100% rename from src/pupil-size/code/helperFunctions/genMeanDiaSamples.m rename to src/ext/pupil-size/code/helperFunctions/genMeanDiaSamples.m diff --git a/src/pupil-size/code/helperFunctions/legacyModeCheck.m b/src/ext/pupil-size/code/helperFunctions/legacyModeCheck.m similarity index 100% rename from src/pupil-size/code/helperFunctions/legacyModeCheck.m rename to src/ext/pupil-size/code/helperFunctions/legacyModeCheck.m diff --git a/src/pupil-size/code/helperFunctions/plotSegments.m b/src/ext/pupil-size/code/helperFunctions/plotSegments.m similarity index 100% rename from src/pupil-size/code/helperFunctions/plotSegments.m rename to src/ext/pupil-size/code/helperFunctions/plotSegments.m diff --git a/src/pupil-size/code/helperFunctions/printToConsole.m b/src/ext/pupil-size/code/helperFunctions/printToConsole.m similarity index 100% rename from src/pupil-size/code/helperFunctions/printToConsole.m rename to src/ext/pupil-size/code/helperFunctions/printToConsole.m diff --git a/src/pupil-size/code/helperFunctions/rawDataFilter.m b/src/ext/pupil-size/code/helperFunctions/rawDataFilter.m similarity index 100% rename from src/pupil-size/code/helperFunctions/rawDataFilter.m rename to src/ext/pupil-size/code/helperFunctions/rawDataFilter.m diff --git a/src/pspm.fig b/src/pspm.fig index a60cba616..515b22220 100644 Binary files a/src/pspm.fig and b/src/pspm.fig differ diff --git a/src/pspm_bf_lcrf_gm.m b/src/pspm_bf_lcrf_gm.m index 96ba91ee5..162ca8dc0 100644 --- a/src/pspm_bf_lcrf_gm.m +++ b/src/pspm_bf_lcrf_gm.m @@ -101,4 +101,4 @@ % apply gamma function % ------------------------------------------------------------------------- gl = gammaln(a); -bs(round(offset/td + 1):end) = A * exp(log(x2).*(a-1) - gl - (x2)./b - log(b)*a); \ No newline at end of file +bs(round(offset/td + 1):end) = A * exp(log(x2-offset).*(a-1) - gl - (x2-offset)./b - log(b)*a); \ No newline at end of file diff --git a/src/pspm_bf_ldrf_gm.m b/src/pspm_bf_ldrf_gm.m index fdf8c8905..35be91a95 100644 --- a/src/pspm_bf_ldrf_gm.m +++ b/src/pspm_bf_ldrf_gm.m @@ -101,5 +101,5 @@ % apply gamma function % ------------------------------------------------------------------------- gl = gammaln(a); -bs(round(offset/td + 1):end) = A * exp(log(x2).*(a-1) - gl - (x2)./b - log(b)*a); +bs(round(offset/td + 1):end) = A * exp(log(x2-offset).*(a-1) - gl - (x2-offset)./b - log(b)*a); diff --git a/src/pspm_bf_spsrf_box.m b/src/pspm_bf_spsrf_box.m index f7cc75e91..40a6ce2a7 100644 --- a/src/pspm_bf_spsrf_box.m +++ b/src/pspm_bf_spsrf_box.m @@ -1,6 +1,9 @@ -function [bs, x] = pspm_bf_spsrf_box( td, soa ) +function [bs, x] = pspm_bf_spsrf_box(varargin) % pspm_bf_spsrf_box basis function dependent on SOA - +% +% FORMAT: [bs, x] = pspm_bf_spsrf_box(td, soa) +% OR: [bs, x] = pspm_bf_spsrf_box([td, soa]) +% % FORMAT: [bf p] = pspm_bf_spsrf_box(td, soa) % with td: time resolution in s % @@ -12,12 +15,15 @@ if isempty(settings), pspm_init; end; % check input arguments -if nargin < 1 - errmsg='No sampling interval stated'; warning('ID:invalid_input',errmsg); return; -end; - -if nargin < 2 - soa = 3.5; +if nargin==0 + errmsg='No sampling interval stated'; warning('ID:invalid_input', errmsg); return; +elseif nargin == 1 + n_el = numel(varargin{1}); + td = varargin{1}(1); + if n_el > 1, soa = varargin{1}(2); else , soa=3.5; end; +elseif nargin > 1 + td = varargin{1}; + soa = varargin{2}; end; diff --git a/src/pspm_bf_spsrf_gamma.m b/src/pspm_bf_spsrf_gamma.m index 0d4ffad12..a7d1fbc3c 100644 --- a/src/pspm_bf_spsrf_gamma.m +++ b/src/pspm_bf_spsrf_gamma.m @@ -1,7 +1,9 @@ -function [bs, t] = pspm_bf_spsrf_gamma( td,soa,p) -% pspm_bf_spsrf_box basis +function [bs, t] = pspm_bf_spsrf_gamma(varargin) +% pspm_bf_spsrf_box basis function with a total duration of 10 seconds +% and a shift of (SOA-3) seconds (see reference). % -% FORMAT: [bf p] = pspm_bf_spsrf_gamma(td, soa,p) +% FORMAT: [bf p] = pspm_bf_spsrf_gamma(td,soa,p) OR +% [bf p] = pspm_bf_spsrf_gamma([td,soa,p]) % with td = time resolution in s % p(1) = A % p(2) = x0 @@ -15,47 +17,62 @@ global settings if isempty(settings), pspm_init; end; - %check input arguments -if nargin < 1 - errmsg='No sampling interval stated'; warning('ID:invalid_input',errmsg); return; +if nargin==0 + errmsg='No sampling interval stated'; warning('ID:invalid_input', errmsg); return; +elseif nargin == 1 + n_el = numel(varargin{1}); + td = varargin{1}(1); + if n_el > 1, soa = varargin{1}(2); else , soa=3.5; end; + if n_el > 2, p = varargin{1}(3:end); else , p = NaN; end; +elseif nargin > 1 + td = varargin{1}; + soa = varargin{2}; + if nargin > 2, p = varargin{3}; else , p=NaN; end; end; -if nargin < 2 - soa = 3.5; +% Check td +if td > 10 + warning('ID:invalid_input', 'Time resolution is larger than duration of the function.'); return; end; -if nargin < 3 - p=[-0.007,0,4,0.5]; +% Check soa +if ~isnumeric(soa) + warning('The SOA should be a numeric value.'); return; +elseif soa < 3 + soa = 3; + warning('Changing SOA to 3s to avoid implausible values (<3s).'); +elseif soa > 7 + warning(['SOA longer than 7s is not recommended. Use at own risk.']); +end; + +% Check p +if ~isnan(p) + p = varargin{3}; + errmsg = 'Basis function parameter must be a numeric vector with 4 elements.'; + if ~isnumeric(p) || numel(p)~=4, warning('ID:invalid_input', errmsg); return; end; +else + % parameters obtained by fitting a gamma function to smoothed test data + p = [-0.00953999201164847,-1.90202591900308,10.0912982464000,0.421253777432825]; end; - +% Computation of bs A = p(1); x0 = p(2); a = p(3); b = p(4); -% default value -d = 10; start = 0; -stop = d + soa; - -if td > (stop-start) - warning('ID:invalid_input', 'Time resolution is larger than duration of the function.'); return; -elseif td == 0 - warning('ID:invalid_input', 'Time resolution must be larger than 0.'); return; -elseif soa < 2 - soa = 2; - stop = d + soa; - warning('Changing SOA to 2s to avoid implausible values (<2s).'); -elseif soa > 8 - warning(['SOA longer than 8s is not recommended. ', ... - 'Use at own risk.']); -end; +stop = 10; % duration of bs 10s by default -shift = soa + x0; +shift = x0 + (soa - 3); t = (start:td:stop-td)'; + bs = A * gampdf(t - shift, a, b); + +bs = bs/max(bs); % Normalizing by the max value +bs = bs./repmat((max(bs) - min(bs)), size(bs, 1), 1); % making it between [0,1] + end diff --git a/src/pspm_compute_visual_angle.m b/src/pspm_compute_visual_angle.m index dbd1b1d1f..3b26448ba 100644 --- a/src/pspm_compute_visual_angle.m +++ b/src/pspm_compute_visual_angle.m @@ -1,31 +1,34 @@ - function [sts, out] = pspm_compute_visual_angle(fn,chan,width,height, distance,unit,options) % pspm_compute_visual_angle computes from gaze data the corresponding -% visual angle (for each data point) - +% visual angle (for each data point). The convention used here is that the +% origin of coordinate system for gaze data is at the bottom left corner of +% the screen. +% % FORMAT: % [sts, out] = pspm_compute_visual_angle(fn,chan,width,height, distance,unit,options) % -% ARGUMENTS: fn: The actual data file containing the eyelink -% recording with gaze data -% chan: On which subset of channels should the conversion -% be done. Supports all values which can be passed -% to pspm_load_data(). The will only work on -% gaze-channels. Other channels specified will be -% ignored. -% width: Width of the display window. Unit is 'unit'. -% height: Height of the display window. Unit is 'unit'. -% distance: distance between eye and screen in length units. -% unit: unit in which width, height and distance are given. -% options: Options struct -% channel_action: ['add'/'replace'] Defines whether the new channels -% should be added or the previous outputs of this function -% should be replaced. -% (Default: 'add') -% eyes: Define on which eye the operations -% should be performed. Possible values -% are: 'left', 'right', 'all'. Default is -% 'all'. +% ARGUMENTS: +% fn: The actual data file containing the eyelink +% recording with gaze data +% chan: On which subset of channels should the conversion +% be done. Supports all values which can be passed +% to pspm_load_data(). The will only work on +% gaze-channels. Other channels specified will be +% ignored. +% width: Width of the display window. Unit is 'unit'. +% height: Height of the display window. Unit is 'unit'. +% distance: distance between eye and screen in length units. +% unit: unit in which width, height and distance are given. +% options: +% .channel_action: ['add'/'replace'] Defines whether the new channels +% should be added or the previous outputs of this function +% should be replaced. +% Default: 'add' +% .eyes: Define on which eye the operations +% should be performed. Possible values +% are: 'l', 'r', 'lr', 'rl'. +% Default: 'lr' +% % RETURN VALUES sts % sts: Status determining whether the execution was % successfull (sts == 1) or not (sts == -1) @@ -70,14 +73,6 @@ return; end; -%set more defaults -if ~isfield(options, 'eyes') - options.eyes = 'all'; -end -if ~isfield(options, 'channels') - options.channels = {'pupil'}; -end - % load data to evaluate [lsts, infos, data] = pspm_load_data(fn,chan); if lsts ~= 1 @@ -85,104 +80,109 @@ return; end; +%set more defaults +if ~isfield(options, 'eyes') + options.eyes = 'lr'; +elseif ~any(strcmpi(options.eyes, {'l', 'r', 'rl', 'lr'})) + warning('ID:invalid_input', ['''options.eyes'' must be ', ... + 'equal to ''l'', ''r'', ''rl'' or ''lr''.']); + return; +end + %iterate through eyes n_eyes = numel(infos.source.eyesObserved); p=1; for i=1:n_eyes eye = lower(infos.source.eyesObserved(i)); - if strcmpi(options.eyes, 'all') || strcmpi(options.eyes(1), eye) + if contains(options.eyes, eye) gaze_x = ['gaze_x_', eye]; gaze_y = ['gaze_y_', eye]; - - % find chars to replace - str_chans = cellfun(@ischar, options.channels); - channels = options.channels; - channels(str_chans) = regexprep(channels(str_chans), ... - '(pupil|gaze_x|gaze_y|pupil_missing)', ['$0_' eye]); - % replace strings with numbers - str_chan_num = channels(str_chans); - for j=1:numel(str_chan_num) - str_chan_num(j) = {find(cellfun(@(y) strcmpi(str_chan_num(j),... - y.header.chantype), data),1)}; - end - channels(str_chans) = str_chan_num; - work_chans = cell2mat(channels); - - if numel(work_chans) >= 1 - % always use first found channel + % always use first found channel + + gx = find(cellfun(@(x) strcmpi(gaze_x, x.header.chantype) & ... + strcmpi('mm', x.header.units), data),1); + gy = find(cellfun(@(x) strcmpi(gaze_y, x.header.chantype) & ... + strcmpi('mm', x.header.units), data),1); - gx = find(cellfun(@(x) strcmpi(gaze_x, x.header.chantype) & ... - strcmpi('mm', x.header.units), data),1); - gy = find(cellfun(@(x) strcmpi(gaze_y, x.header.chantype) & ... - strcmpi('mm', x.header.units), data),1); + if ~isempty(gx) && ~isempty(gy) + + visual_angl_chans{p} = data{gx}; + visual_angl_chans{p+1} = data{gy}; + + % get channel specific data + gx_d = data{gx}.data; + gy_d = data{gy}.data; - if ~isempty(gx) && ~isempty(gy) - - visual_angl_chans{p} = data{gx}; - visual_angl_chans{p+1} = data{gy}; - - % get channel specific data - gx_d = data{gx}.data; - gy_d = data{gy}.data; - gy_d = data{gy}.header.range(2)-gy_d; - - N = numel(gx_d); - if N~=numel(gy_d) - warning('ID:invalid_input', 'length of data in gaze_x and gaze_y is not the same'); - return; - end; - - % move (0,0) into center of the screen - gx_d = gx_d - width/2; - gy_d = gy_d - height/2; - - %compute visual angle for gaze_x and gaze_y - s_x = gx_d; % x axis in spherical coordinates - s_y = distance * ones(numel(gx_d),1);% y axis in spherical coordinates, actually is the radial from participant to the screen - s_z = gy_d; % z axis in spherical coordinates, actually is y axis on the screen - [azimuth, elevation, r]= cart2sph(s_x,s_y,s_z);% convert cartesian to spherical coordinates in radians, azimuth = longitude, elevation = latitude - - lat = rad2deg(elevation);% convert radians into degrees - lon = rad2deg(azimuth); - - %compute visual angle for range - r_x = [-width/2,width/2,0,0]'; - r_y = distance * ones(numel(r_x),1); - r_z = [0,0,-height/2,height/2]'; - [x_range_sp, y_range_sp,r_range]= cart2sph(r_x,r_y,r_z); - x_range_sp = rad2deg(x_range_sp); - y_range_sp = rad2deg(y_range_sp); - - % azimuth angle of gaze points - % longitude (azimuth angle from positive x axis in horizontal plane) of gaze points - visual_angl_chans{p}.data = lon; - visual_angl_chans{p}.header.units = 'degree'; - visual_angl_chans{p}.header.range = [x_range_sp(1),x_range_sp(2)]; -% visual_angl_chans{p}.header.r = r; -% visual_angl_chans{p}.header.r_range = r_range; - - % elevation angle of gaze points, - % latitude (elevation angle from horizontal plane) of gaze points - visual_angl_chans{p+1}.data = lat; - visual_angl_chans{p+1}.header.units = 'degree'; - visual_angl_chans{p+1}.header.range = [y_range_sp(3),y_range_sp(4)]; -% visual_angl_chans{p+1}.header.r = r; -% visual_angl_chans{p+1}.header.r_range = r_range; - - p=p+2; - else - pfrintf('%s eye does not contain gaze_x and gaze_y data.\n',eye); - warning('ID:invalid_input','not enough data to compute visual angle for that eye'); + % The convention is that the origin of the screen is in the bottom + % left corner, so the following line is not needed a priori, but I + % leave it anyway just in case : + % gy_d = data{gy}.header.range(2)-gy_d; + + N = numel(gx_d); + if N~=numel(gy_d) + warning('ID:invalid_input', 'length of data in gaze_x and gaze_y is not the same'); + return; end; - else - warning('ID:invalid_input', ['Unable to perform gaze ', ... - 'validation. There must be a pupil channel. Eventually ', ... - 'only gaze channels have been imported.']); + + % move (0,0) into center of the screen + gx_d = gx_d - width/2; + gy_d = gy_d - height/2; + + % compute visual angle for gaze_x and gaze_y data: + % 1) x axis in cartesian coordinates + s_x = gx_d; + % 2) y axis in cartesian coordinates, actually the distance from participant to the screen + s_y = distance * ones(numel(gx_d),1); + % 3) z axis in spherical coordinates, actually the y axis of the screen + s_z = gy_d; + % 4) convert cartesian to spherical coordinates in radians, + % where azimuth = longitude, elevation = latitude + % the center of spherical coordinates are the eyes of the subject + [azimuth, elevation, ~]= cart2sph(s_x,s_y,s_z); + % 5) convert radians into degrees + lat = rad2deg(elevation); + lon = rad2deg(azimuth); + + % compute visual angle for the range (same procedure) + r_x = [-width/2,width/2,0,0]'; + r_y = distance * ones(numel(r_x),1); + r_z = [0,0,-height/2,height/2]'; + [x_range_sp, y_range_sp,~]= cart2sph(r_x,r_y,r_z); + x_range_sp = rad2deg(x_range_sp); + y_range_sp = rad2deg(y_range_sp); + + % azimuth angle of gaze points + % longitude (azimuth angle from positive x axis in horizontal plane) of gaze points + visual_angl_chans{p}.data = lon; + visual_angl_chans{p}.header.units = 'degree'; + visual_angl_chans{p}.header.range = [x_range_sp(1),x_range_sp(2)]; + % visual_angl_chans{p}.header.r = r; % radial coordinates omitted + % visual_angl_chans{p}.header.r_range = r_range; % radial coordinates omitted + + % elevation angle of gaze points, + % latitude (elevation angle from horizontal plane) of gaze points + visual_angl_chans{p+1}.data = lat; + visual_angl_chans{p+1}.header.units = 'degree'; + visual_angl_chans{p+1}.header.range = [y_range_sp(3),y_range_sp(4)]; + % visual_angl_chans{p+1}.header.r = r; % radial coordinates omitted + % visual_angl_chans{p+1}.header.r_range = r_range; % radial coordinates omitted + + p=p+2; + else + fails{i} = sprintf('There are no channels gaze_x and gaze_y for eyes ''%s''.',eye); end; end; end; +if p==1 + for i = 1:numel(fails) + disp(fails{i}) + end + warning('ID:invalid_input','Not enough data to compute visual angle.'); + return; +end; + [lsts, outinfo] = pspm_write_channel(fn, visual_angl_chans, options.channel_action); if lsts ~= 1 warning('ID:invalid_input', 'Could not write converted data.'); diff --git a/src/pspm_convert_pixel2unit.m b/src/pspm_convert_pixel2unit.m index 3e827489b..74d97072b 100644 --- a/src/pspm_convert_pixel2unit.m +++ b/src/pspm_convert_pixel2unit.m @@ -2,7 +2,9 @@ height, distance, options) % pspm_convert_pixel2unit allows to transfer gaze data from pixel to units. % This facilitates the use of pspm_find_valid_fixations() which needs data -% in unit values. +% in unit values. The convention used here is that the center of coordinate in +% the desired units would be set to at the center of the [0,0] pixel which is +% in the bottom left corner of the screen. % % Usage: % [sts, out] = pspm_convert_pixel2unit(fn, chan, unit, width, height, options) @@ -14,7 +16,8 @@ % be done. Supports all values which can be passed % to pspm_load_data(). The will only work on % gaze-channels. Other channels specified will be -% ignored.(For conversion into 'degree' there must be the same amount for gane_x channels as gaze_y channels) +% ignored.(For conversion into 'degree' there must be +% the same amount of gane_x as gaze_y channels) % unit: unit to which the measurements should be % converted. % The value can contain any length unit or @@ -110,7 +113,10 @@ gaze_chans = data(gaze_idx); n_chans = numel(gaze_chans); - +if n_chans == 0 + warning('ID:invalid_input','No gaze channels found, nothing to do.') + return; +end %diffenrentiate which units to which unit to convert if strcmpi(unit,'degree') @@ -128,21 +134,23 @@ % pick conversion factor according to channel type x / y coord if ~isempty(regexp(chan.header.chantype, 'gaze_x_', 'once')) - fact = width; + screen_length = width; else - fact = height; + screen_length = height; end; - % convert according to range - chan.data = (chan.data-chan.header.range(1)) ... - ./ diff(chan.header.range) * fact; - - % convert range - chan.header.range = (chan.header.range-chan.header.range(1)) ... - ./ diff(chan.header.range) * fact; - + % length per pixel along width or height + lenght_per_pixel = screen_length ./ (diff(chan.header.range) + 1); + + % baseline data in pixels wrt. the range (i.e. pixels of interest) + pixel_index = chan.data-chan.header.range(1); + % convert indices into coordinates in the units of interests + chan.data = pixel_index * lenght_per_pixel ; + % same procedure for the range (baseline + conversion) + chan.header.range = (chan.header.range-chan.header.range(1)) * lenght_per_pixel ; + % writting the new units into the structure chan.header.units = unit_h_w_d; else warning('ID:invalid_input', ['Not converting (%s) because ', ... @@ -161,7 +169,13 @@ if strcmpi(unit,'degree') options.channel_action = 'replace'; - [lsts, outinfo] = pspm_compute_visual_angle(fn,0,width, height, distance,unit_h_w_d,options); + [lsts, outinfo] = pspm_compute_visual_angle(fn,outinfo.channel, ... + width, height, distance,unit_h_w_d,options); + if lsts < 1 + warning('ID:compute_visual_angle_err',... + 'An error occured during the computation of the visual angle.'); + return; + end; end; diff --git a/src/pspm_convert_visangle2sps.m b/src/pspm_convert_visangle2sps.m index 720158468..73ccaefb8 100644 --- a/src/pspm_convert_visangle2sps.m +++ b/src/pspm_convert_visangle2sps.m @@ -19,8 +19,8 @@ % found gaze data channels with type 'degree' % eyes: Define on which eye the operations % should be performed. Possible values -% are: 'left', 'right', 'all'. Default is -% 'all'. +% are: 'l', 'r', 'lr', 'rl'. +% Default: 'lr' % % OUTPUT: % sts: Status determining whether the execution was @@ -38,7 +38,7 @@ warning('ID:invalid_input', 'Nothing to do.'); return; elseif nargin<2 channels = 0; - options = struct('eyes','all'); + options = struct('eyes','lr'); end if isfield(options, 'chans') channels = options.chans; @@ -50,12 +50,14 @@ channels = 0; end +% option.eyes if ~isfield(options, 'eyes') - options.eyes = 'all'; + options.eyes = 'lr'; +elseif ~any(strcmpi(options.eyes, {'l', 'r', 'rl', 'lr'})) + warning('ID:invalid_input', ['''options.eyes'' must be either ''l'', ', ... + '''r'', ''rl'' or ''lr''.']); + return; end; -if ~isfield(options, 'channels') - options.channels = {'pupil'}; -end % fn if ~ischar(fn) || ~exist(fn, 'file') @@ -63,15 +65,6 @@ 'seem to exist.'], fn); return; end; - - -if ~any(strcmpi(options.eyes, {'all', 'left', 'right'})) - warning('ID:invalid_input', ['Options.eyes must be either ''all'', ', ... - '''left'' or ''right''.']); - return; -end; - - % load data to evaluate [lsts, infos, data] = pspm_load_data(fn, channels); if lsts ~= 1 @@ -84,7 +77,7 @@ for i=1:n_eyes eye = lower(infos.source.eyesObserved(i)); - if strcmpi(options.eyes, 'all') || strcmpi(options.eyes(1), eye) + if contains(options.eyes, eye) gaze_x = ['gaze_x_', eye]; gaze_y = ['gaze_y_', eye]; diff --git a/src/pspm_display.m b/src/pspm_display.m index be44afb2c..43da00cf6 100644 --- a/src/pspm_display.m +++ b/src/pspm_display.m @@ -782,6 +782,12 @@ function ed_y_max_CreateFcn(hObject, eventdata, handles) ylabel(' Interpolated IBI [ms] ','Fontsize',14) elseif strcmp(handles.prop.wave,'pupil') ylabel(' size in arbitrary units ','Fontsize',14) + elseif contains(handles.prop.wave,'pupil') + ylabel([' Pupil size [',unit,'] '],'Fontsize',14) + elseif contains(handles.prop.wave,'gaze') && contains(handles.prop.wave,'x') + ylabel([' Gaze x coordinate [',unit,'] '],'Fontsize',14) + elseif contains(handles.prop.wave,'gaze') && contains(handles.prop.wave,'y') + ylabel([' Gaze y coordinate [',unit,'] '],'Fontsize',14) else ylabel([' unknown unit [',unit,'] '],'Fontsize',14) end diff --git a/src/pspm_ecg2hb_amri.m b/src/pspm_ecg2hb_amri.m index ac8817d43..4a3563ba6 100644 --- a/src/pspm_ecg2hb_amri.m +++ b/src/pspm_ecg2hb_amri.m @@ -177,7 +177,7 @@ % process % ------------------------------------------------------------------------- - addpath(pspm_path('amri_eegfmri')); + addpath(pspm_path('ext','amri_eegfmri')); ecg.data = data{1}.data; ecg.srate = data{1}.header.sr; rpeak_logic_vec = amri_eeg_rpeak(ecg, ... @@ -189,7 +189,7 @@ 'minrpa', options.min_relative_amplitude ... ); heartbeats{1}.data = find(rpeak_logic_vec) / ecg.srate; - rmpath(pspm_path('amri_eegfmri')); + rmpath(pspm_path('ext','amri_eegfmri')); % save % ------------------------------------------------------------------------- diff --git a/src/pspm_extract_segments.m b/src/pspm_extract_segments.m index a668666e7..ce3d639a3 100644 --- a/src/pspm_extract_segments.m +++ b/src/pspm_extract_segments.m @@ -1,680 +1,732 @@ function [sts, out] = pspm_extract_segments(varargin) -% pspm_extract_segments. Function in order to extract segments of a certain -% length after defined onsets and create summary statistics -% (mean, SD, SEM, % NaN) over these segments -% -% The function supports either manual setting of data files, channels, -% timing and timeunits or automatic extraction from a glm model file. -% -% The segments variable returned will be a cx1 cell where c corresponds to -% the number of conditions. Each element contains a struct with -% fields data, mean, std and sem (std of the mean). -% The field data is a nxo*s vector where n is number of data points and o*s -% corresponds to the onsets multiplied by the sessions. -% -% FORMAT: -% [sts, segments] = pspm_extract_segments('manual', data_fn, chan, timing, options) -% [sts, segments] = pspm_extract_segments('auto', glm, options) -% [sts, segments] = pspm_extract_segments('auto', dcm, options) -% -% ARGUMENTS: -% mode: Tells the function in which mode get the -% settings from. Either 'manual' or 'auto'. -% glm: Path to the glm file or a glm structure. -% dcm: Path to the dcm file or a dcm structure. -% data_fn: Path or cell of paths to data files from which -% the segments should be extracted. Each file -% will be treated as session. Onset values are -% averaged through conditions and sessions. -% chan: Channel number or cell of channel numbers which -% defines which channel should be taken to -% extract the segments. Chan should correspond to -% data_fn and should have the same length. If -% data_fn is a cell and chan is a single number, -% the number will be taken for all files. -% timing: Either a cell containing the timing settings or -% a string pointing to the timing file. -% options: -% timeunit: 'seconds' (default), 'samples' or 'markers. In 'auto' -% mode the value will be ignored and taken from -% the glm model file or the dcm model file. -% length: Length of the segments in the 'timeunits'. -% If given the same length is taken for -% segments for glm structure. If not given lengths -% are take from the timing data. This argument is optional. If -% 'timeunit' equals 'markers' then 'length' is -% expected to be in seconds. -% For dcm structures the option length will be -% ignored and length will be set from timing -% data. -% plot: If 1 mean values (solid) and standard error of -% the mean (dashed) will be ploted. Default is 0. -% outputfile: Define filename to store segments. If is equal -% to '', no file will be written. Default is 0. -% overwrite: Define if already existing files should be -% overwritten. Default ist 0. -% marker_chan: Mandatory if timeunit is 'markers'. For the -% function to find the appropriate timing of the -% specified marker ids. Must have the same format -% as data_fn. -% nan_output: This option defines whether the user wants to -% output the NaN ratios of the trials for each condition. -% If so, we values can be printed on the screen -% (on MATLAB command window) or written to a created file. -% The field can be set to 'screen', 'File Output'or -% 'none'. 'none' is the default value. -%__________________________________________________________________________ -% PsPM 4.3 -% (C) 2008-2018 Tobias Moser (University of Zurich) - -% $Id: pspm_extract_segments.m 733 2019-06-20 12:47:45Z esrefo $ -% $Rev: 733 $ - -% initialise -% ------------------------------------------------------------------------- -global settings; -if isempty(settings), pspm_init; end; -sts = -1; - -if nargin >= 2 - switch varargin{1} - case 'manual' - if nargin < 4 - warning('ID:invalid_input', 'Mode ''auto'' expects at least 4 arguments.'); return; - end; - - data_fn = varargin{2}; - chan = varargin{3}; - timing = varargin{4}; - - if nargin == 5 - options = varargin{5}; - else - options = struct(); - end; - - % expand chan if necessary - if iscell(data_fn) && isnumeric(chan) ... - && numel(chan) == 1 - chan = repmat({chan}, size(data_fn)); - end; - - % check if specific arguments are correct - if ~ischar(data_fn) - if (iscell(data_fn) && any(~cellfun(@ischar, data_fn))) ||~iscell(data_fn) - warning('ID:invalid_input', 'data_fn has to be a string or a cell array of strings.'); return; + % pspm_extract_segments. Function in order to extract segments of a certain + % length after defined onsets and create summary statistics + % (mean, SD, SEM, % NaN) over these segments + % + % The function supports either manual setting of data files, channels, + % timing and timeunits or automatic extraction from a glm model file. + % + % The segments variable returned will be a cx1 cell where c corresponds to + % the number of conditions. Each element contains a struct with + % fields data, mean, std and sem (std of the mean). + % The field data is a nxo*s vector where n is number of data points and o*s + % corresponds to the onsets multiplied by the sessions. + % + % FORMAT: + % [sts, segments] = pspm_extract_segments('manual', data_fn, chan, timing, options) + % [sts, segments] = pspm_extract_segments('manual', data_raw, sr, timing, options) + % [sts, segments] = pspm_extract_segments('auto', glm, options) + % [sts, segments] = pspm_extract_segments('auto', dcm, options) + % + % ARGUMENTS: + % mode: Tells the function in which mode get the + % settings from. Either 'manual' or 'auto'. + % glm: Path to the glm file or a glm structure. + % dcm: Path to the dcm file or a dcm structure. + % data_fn: Path or cell of paths to data files from which + % the segments should be extracted. Each file + % will be treated as session. Onset values are + % averaged through conditions and sessions. + % data_raw: Numeric raw data or a cell array of numeric raw data. + % chan: Channel number or cell of channel numbers which + % defines which channel should be taken to + % extract the segments. Chan should correspond to + % data_fn and should have the same length. If + % data_fn is a cell and chan is a single number, + % the number will be taken for all files. + % sr: Array of sampling rates of same dimension as + % the cell array data_raw or one sample rate + % if all the data have the same one. + % timing: Either a cell containing the timing settings or + % a string pointing to the timing file. + % options: + % timeunit: 'seconds' (default), 'samples' or 'markers'. In 'auto' + % mode the value will be ignored and taken from + % the glm model file or the dcm model file. + % In the case of raw data the timeunit should + % be seconds. + % length: Length of the segments in the 'timeunits'. + % If given the same length is taken for + % segments for glm structure. If not given lengths + % are take from the timing data. This argument is optional. If + % 'timeunit' equals 'markers' then 'length' is + % expected to be in seconds. + % For dcm structures the option length will be + % ignored and length will be set from timing + % data. + % plot: If 1 mean values (solid) and standard error of + % the mean (dashed) will be ploted. Default is 0. + % outputfile: Define filename to store segments. If is equal + % to '', no file will be written. Default is 0. + % overwrite: Define if already existing files should be + % overwritten. Default ist 0. + % marker_chan: Mandatory if timeunit is 'markers'. For the + % function to find the appropriate timing of the + % specified marker ids. Must have the same format + % as data_fn. + % If timeunit is 'markers' and raw data are + % given then this parameter should be an + % cell array of numeric array of marker data. + % nan_output: This option defines whether the user wants to + % output the NaN ratios of the trials for each condition. + % If so, we values can be printed on the screen + % (on MATLAB command window) or written to a created file. + % The field can be set to 'screen', 'File Output'or + % 'none'. 'none' is the default value. + %__________________________________________________________________________ + % PsPM 4.3 + % (C) 2008-2018 Tobias Moser (University of Zurich) + + % $Id: pspm_extract_segments.m 733 2019-06-20 12:47:45Z esrefo $ + % $Rev: 733 $ + + % ------------------------------------------------------------------------- + % DEVELOPERS NOTES: + % This function uses three different flags encoded in the variable + % "manual_chosen", it can take the following values: + % - manual_chosen = 0 ---> it means the function runs in auto mode + % - manual_chosen = 1 ---> it means the function runs in manual mode + % but the given data are not raw but + % filenames + % - manual_chosen = 2 ---> it means the function runs in manual mode + % and with raw data. + % Search FLAG to see where these flags are set. + % ------------------------------------------------------------------------- + + global settings; + if isempty(settings), pspm_init; end; + sts = -1; + + if nargin >= 2 + switch varargin{1} + case 'manual' + if nargin < 4 + warning('ID:invalid_input', 'Mode ''manual'' expects at least 4 arguments.'); return; end - elseif ~isnumeric(chan) - if(iscell(chan) && any(~cellfun(@isnumeric, chan))) || ~iscell(chan) - warning('ID:invalid_input', 'chan has to be numeric or a cell array of numerics.'); return; + + data_fn = varargin{2}; + chan = varargin{3}; + timing = varargin{4}; + + if nargin == 5 + options = varargin{5}; + else + options = struct(); end - elseif strcmpi(class(data_fn), class(chan)) && (iscell(chan) && (numel(chan) ~= numel(data_fn))) - warning('ID:invalid_input', 'data_fn and chan must correspond in number of elements.'); return; - elseif strcmpi(class(data_fn), class(timing)) && (iscell(timing) && (numel(timing) ~= numel(data_fn))) - warning('ID:invalid_input', 'data_fn and timing must correspond in number of elements.'); return; - end; - - % fix format of data_fn and chan if necessary - if ~iscell(data_fn) - data_fn = {data_fn}; - end; - if ~iscell(chan) - chan = {chan}; - end; - - % set flag to indicate 'manual' - manual_chosen =1; - - case 'auto' - - struct_file = varargin{2}; - %case distinction on the type of the glm argument - %if it is a path we need to load the glm structure into - %function - if ~isstruct(struct_file) - if ~ischar(struct_file) || ~exist(struct_file, 'file') - warning('ID:invalid_input', 'GLM file is not a string or does not exist.'); return; - end; - [~, model_strc, ~] = pspm_load1(struct_file, 'all'); - else - model_strc = struct_file; - end - - if nargin == 3 - options = varargin{3}; - else - options = struct(); - end; - - data_fn = model_strc.input.datafile; - n_file = numel(data_fn); - timing = model_strc.input.timing; - chan = repmat({model_strc.input.channel}, size(data_fn)); - - if strcmpi(model_strc.modeltype,'glm') - options.timeunit = model_strc.input.timeunits; - if strcmpi(options.timeunit, 'markers') - if isfield(model_strc.input.options, 'marker_chan_num') - options.marker_chan = model_strc.input.options.marker_chan_num; + + % check data_fn variable (and creation of data_raw if needed) + if ~ischar(data_fn) && ~isnumeric(data_fn) + if ~iscell(data_fn) || ~xor(any(~cellfun(@ischar, data_fn)), ... + any(~cellfun(@isnumeric, data_fn))) + warning('ID:invalid_input', 'Data must be a filename, a cell array of filenames or a cell array of raw data.'); return; + elseif ischar(data_fn{1}) + manual_chosen = 1; % set FLAG to indicate 'manual with not raw data' + elseif isnumeric(data_fn{1}) + data_raw = data_fn; + manual_chosen = 2; % set FLAG to indicate 'manual with raw data' + clear data_fn + end + elseif ischar(data_fn) + data_fn = {data_fn}; + manual_chosen = 1; % set FLAG to indicate 'manual with not raw data' + elseif isnumeric(data_fn) + data_raw = {data_fn}; + manual_chosen = 2; % set FLAG to indicate 'manual with raw data' + clear data_fn + end + + % check chan variable (and creation of sr if needed) + if isnumeric(chan) && numel(chan) == 1 + if manual_chosen == 1 + chan = repmat({chan}, size(data_fn)); else - warning('ID:invalid_input', ['''markers'' defined as ', ... - 'timeunit, but cannot load the corresponding ', ... - 'marker channel information from the GLM input.']); + sr = repmat({chan}, size(data_raw)); + clear chan + end + else + if ~iscell(chan) || (any(~cellfun(@isnumeric, chan)) && manual_chosen == 1) + warning('ID:invalid_input', 'chan has to be numeric or a cell array of numerics.'); return; + elseif ~iscell(chan) || (any(~cellfun(@isnumeric, chan)) && manual_chosen == 2) + warning('ID:invalid_input', 'sr has to be numeric or a cell array of numerics.'); return; + elseif manual_chosen == 2 + sr = chan; + end + end + + if manual_chosen == 1 + if strcmpi(class(data_fn), class(chan)) && (numel(chan) ~= numel(data_fn)) + warning('ID:invalid_input', 'data_fn and chan must correspond in number of elements.'); return; + elseif strcmpi(class(data_fn), class(timing)) && (iscell(timing) && (numel(timing) ~= numel(data_fn))) + warning('ID:invalid_input', 'data_fn and timing must correspond in number of elements.'); return; + end + else + if strcmpi(class(data_raw), class(sr)) && (numel(sr) ~= numel(data_raw)) + warning('ID:invalid_input', 'data_fn and chan must correspond in number of elements.'); return; + elseif strcmpi(class(data_raw), class(timing)) && (numel(timing) ~= numel(data_raw)) + warning('ID:invalid_input', 'data_fn and timing must correspond in number of elements.'); return; + end + end + + case 'auto' + + struct_file = varargin{2}; + %case distinction on the type of the glm argument + %if it is a path we need to load the glm structure into + %function + if ~isstruct(struct_file) + if ~ischar(struct_file) || ~exist(struct_file, 'file') + warning('ID:invalid_input', 'GLM file is not a string or does not exist.'); return; end; + [~, model_strc, ~] = pspm_load1(struct_file, 'all'); + else + model_strc = struct_file; + end + + if nargin == 3 + options = varargin{3}; + else + options = struct(); end; - end; - - manual_chosen =0; - - otherwise - warning('ID:invalid_input', 'Unknown mode specified.'); return; + + data_fn = model_strc.input.datafile; + n_file = numel(data_fn); + timing = model_strc.input.timing; + chan = repmat({model_strc.input.channel}, size(data_fn)); + + if strcmpi(model_strc.modeltype,'glm') + options.timeunit = model_strc.input.timeunits; + if strcmpi(options.timeunit, 'markers') + if isfield(model_strc.input.options, 'marker_chan_num') + options.marker_chan = model_strc.input.options.marker_chan_num; + else + warning('ID:invalid_input', ['''markers'' defined as ', ... + 'timeunit, but cannot load the corresponding ', ... + 'marker channel information from the GLM input.']); + end; + end; + end; + + manual_chosen = 0; % set FLAG to indicate 'not manual', i.e. 'auto' + + otherwise + warning('ID:invalid_input', 'Unknown mode specified.'); return; + end; + else + warning('ID:invalid_input', 'The function expects at least 2 parameters.'); return; end; -else - warning('ID:invalid_input', 'The function expects at least 2 parameters.'); return; -end; - -if ~iscell(data_fn) - data_fn = {data_fn}; -end; - -if ~isstruct(options) - warning('ID:invalid_input', 'Options must be a struct.'); return; -end; - -% set default timeunit -if ~isfield(options, 'timeunit') - options.timeunit = 'seconds'; -else - options.timeunit = lower(options.timeunit); -end; - -% set default marker_chan, if it is a glm struct -if (manual_chosen ==1) || strcmpi(model_strc.modeltype,'glm') - if ~isfield(options, 'marker_chan') - options.marker_chan = repmat({-1}, numel(data_fn),1); - elseif ~iscell(options.marker_chan) - options.marker_chan = repmat({options.marker_chan}, size(data_fn)); + + if (manual_chosen == 0) && ~iscell(data_fn) + data_fn = {data_fn}; end; -end; - -% set default length -if ~isfield(options, 'length') - options.length = -1; -end; - -% default plot -if ~isfield(options, 'plot') - options.plot = 0; -end; - -% outputfile -if ~isfield(options, 'outputfile') - options.outputfile = ''; -end; - -% overwrite -if ~isfield(options, 'overwrite') - options.overwrite = 0; -end; - -% dont_ask_overwrite -if ~isfield(options, 'dont_ask_overwrite') - options.dont_ask_overwrite = 0; -end; - -%set default ouput_nan -if ~isfield(options, 'nan_output')|| strcmpi(options.nan_output, 'none') - options.nan_output = 'none'; -elseif ~strcmpi( options.nan_output,'screen') - [path, name, ext ]= fileparts(options.nan_output); - if 7 ~= exist(path, 'dir') - warning('ID:invalid_input', 'Path for nan_output does not exist'); return; - end -end - -% check mutual arguments (options) -if ~ismember(options.timeunit, {'seconds','samples', 'markers'}) - warning('ID:invalid_input', 'Invalid timeunit, use either ''markers'', ''seconds'' or ''samples'''); return; -elseif ~isnumeric(options.length) - warning('ID:invalid_input', 'options.length is not numeric.'); return; -elseif ~isnumeric(options.plot) && ~islogical(options.plot) - warning('ID:invalid_input', 'options.plot is not numeric.'); return; -elseif ~isempty(options.outputfile) && ~ischar(options.outputfile) - warning('ID:invalid_input', 'options.outputfile has to be a string.'); return; -elseif ~isnumeric(options.overwrite) && ~islogical(options.overwrite) - warning('ID:invalid_input', 'Options.overwrite has to be numeric or logical.'); return; -elseif ~isnumeric(options.dont_ask_overwrite) && ~islogical(options.dont_ask_overwrite) - warning('ID:invalid_input', 'Options.dont_ask_overwrite has to be numeric or logical.'); return; -elseif strcmpi(options.timeunit, 'markers') && ~all(size(data_fn) == size(options.marker_chan)) - warning('ID:invalid_input', '''data_fn'' and ''options.marker_chan'' do not have the same size.'); return; -elseif (manual_chosen ==1) || strcmpi(model_strc.modeltype,'glm') - if any(cellfun(@(x) ~strcmpi(x, 'marker') && ~isnumeric(x), options.marker_chan)) - warning('ID:invalid_input', 'Options.marker_chan has to be numeric or ''marker''.'); return; - elseif strcmpi(options.timeunit, 'markers') ... - && any(cellfun(@(x) isnumeric(x) && x <= 0, options.marker_chan)) - warning('ID:invalid_input', ['''markers'' specified as a timeunit but ', ... - 'no valid marker channel is defined.']); return; + + if ~isstruct(options) + warning('ID:invalid_input', 'Options must be a struct.'); return; + end; + + % set default timeunit + if ~isfield(options, 'timeunit') + options.timeunit = 'seconds'; + else + options.timeunit = lower(options.timeunit); + end; + + % set default marker_chan, if it is a glm struct (only for non-raw data) + if manual_chosen == 1 || (manual_chosen == 0 && strcmpi(model_strc.modeltype,'glm')) + if ~isfield(options, 'marker_chan') + options.marker_chan = repmat({-1}, numel(data_fn),1); + elseif ~iscell(options.marker_chan) + options.marker_chan = repmat({options.marker_chan}, size(data_fn)); + end; end; -end; - -if manual_chosen == 1 || strcmpi(model_strc.modeltype, 'glm') - n_sessions = numel(data_fn); -else - n_sessions = numel(model_strc.input.scr); -end - -% load timing -if manual_chosen == 1 - [~, multi] = pspm_get_timing('onsets', timing, options.timeunit); - % If the timeunit is markers, the multi struct holds for every session. - % Thus we need as many replicas as there are sessions - if strcmpi(options.timeunit, 'markers') - temp = multi; - clear multi; - for k=1:n_sessions - multi(k) = temp; + + % set default length + if ~isfield(options, 'length') + options.length = -1; + end; + + % default plot + if ~isfield(options, 'plot') + options.plot = 0; + end; + + % outputfile + if ~isfield(options, 'outputfile') + options.outputfile = ''; + end; + + % overwrite + if ~isfield(options, 'overwrite') + options.overwrite = 0; + end; + + %set default ouput_nan + if ~isfield(options, 'nan_output')|| strcmpi(options.nan_output, 'none') + options.nan_output = 'none'; + elseif ~strcmpi( options.nan_output,'screen') + [path, name, ext ]= fileparts(options.nan_output); + if 7 ~= exist(path, 'dir') + warning('ID:invalid_input', 'Path for nan_output does not exist'); return; end end - input_data = {}; - sampling_rates = []; - marker_data = {}; - for i=1:numel(data_fn) - [sts, ~, data] = pspm_load_data(data_fn{i}, chan{i}); - assert(sts == 1); - input_data{end + 1} = data{1}.data; - sampling_rates(end + 1) = data{1}.header.sr; + + % check mutual arguments (options) + if ~ismember(options.timeunit, {'seconds','samples', 'markers'}) + warning('ID:invalid_input', 'Invalid timeunit, use either ''markers'', ''seconds'' or ''samples'''); return; + elseif ~isnumeric(options.length) + warning('ID:invalid_input', 'options.length is not numeric.'); return; + elseif ~isnumeric(options.plot) && ~islogical(options.plot) + warning('ID:invalid_input', 'options.plot is not numeric.'); return; + elseif ~isempty(options.outputfile) && ~ischar(options.outputfile) + warning('ID:invalid_input', 'options.outputfile has to be a string.'); return; + elseif ~isnumeric(options.overwrite) && ~islogical(options.overwrite) + warning('ID:invalid_input', 'Options.overwrite has to be numeric or logical.'); return; + elseif strcmpi(options.timeunit, 'markers') && manual_chosen == 2 && ~isfield(options,'marker_chan') + warning('ID:invalid_input','''markers'' specified as a timeunit but nothing was specified in ''options.marker_chan''') + elseif strcmpi(options.timeunit, 'markers') && manual_chosen == 2 && ~all(size(data_raw) == size(options.marker_chan)) + warning('ID:invalid_input', '''data_raw'' and ''options.marker_chan'' do not have the same size.'); return; + elseif strcmpi(options.timeunit, 'markers') && manual_chosen == 1 && ~all(size(data_fn) == size(options.marker_chan)) + warning('ID:invalid_input', '''data_fn'' and ''options.marker_chan'' do not have the same size.'); return; + elseif manual_chosen == 1 || (manual_chosen == 0 && strcmpi(model_strc.modeltype,'glm')) + if any(cellfun(@(x) ~strcmpi(x, 'marker') && ~isnumeric(x), options.marker_chan)) + warning('ID:invalid_input', 'Options.marker_chan has to be numeric or ''marker''.'); return; + elseif strcmpi(options.timeunit, 'markers') ... + && any(cellfun(@(x) isnumeric(x) && x <= 0, options.marker_chan)) + warning('ID:invalid_input', ['''markers'' specified as a timeunit but ', ... + 'no valid marker channel is defined.']); return; + end; + end; + + if manual_chosen == 2 + n_sessions = numel(data_raw); + elseif manual_chosen == 1 || strcmpi(model_strc.modeltype, 'glm') + n_sessions = numel(data_fn); + else + n_sessions = numel(model_strc.input.scr); + end; + + % load timing + if manual_chosen ~= 0 + [~, multi] = pspm_get_timing('onsets', timing, options.timeunit); + % If the timeunit is markers, the multi struct holds for every session. + % Thus we need as many replicas as there are sessions if strcmpi(options.timeunit, 'markers') - [sts, ~, data] = pspm_load_data(data_fn{i}, options.marker_chan{i}); - assert(sts == 1); - marker_data{end + 1} = data; + temp = multi; + clear multi; + for k=1:n_sessions + multi(k) = temp; + end end - end -elseif strcmpi(model_strc.modeltype, 'glm') - multi = model_strc.timing.multi; - input_data = model_strc.input.data; - sampling_rates = model_strc.input.sr; - filtered_sr = model_strc.input.filter.down; -else - % want to map the informations of dcm into a multi - cond_names = unique(model_strc.trlnames); - - if numel(cond_names) == numel(model_strc.trlnames) - model_strc.trlnames(:) = {'all_cond'}; - cond_names(:) = {'all_cond'}; - end - - point=1; - for i = 1:n_sessions - nr_trials_in_sess = size(model_strc.input.trlstart{i},1); - - min_iti = min(model_strc.input.iti{i}); - min_trl_interval = min(model_strc.input.trlstop{i} - model_strc.input.trlstart{i}); - durations(1:nr_trials_in_sess) = min_iti + min_trl_interval; - - if(numel(cond_names)>1) - multi(i).names = unique(model_strc.trlnames(point:point+nr_trials_in_sess-1))'; - % we define the segment_length as min(intertrial-interval)+ - % min(trialoffset - trialonset) - for j=1: numel(cond_names) - idx_start = point; - idx_stop = point+nr_trials_in_sess-1; - cond_name = cond_names{j}; - cond_idx = find(strcmpi(cond_name, multi(i).names)); - if isempty(cond_idx) - continue + input_data = {}; + sampling_rates = []; + marker_data = {}; + if manual_chosen == 1 + for i=1:numel(data_fn) + [sts, ~, data] = pspm_load_data(data_fn{i}, chan{i}); + assert(sts == 1); + input_data{end + 1} = data{1}.data; + sampling_rates(end + 1) = data{1}.header.sr; + if strcmpi(options.timeunit, 'markers') + [sts, ~, data] = pspm_load_data(data_fn{i}, options.marker_chan{i}); + assert(sts == 1); + marker_data{end + 1} = data{1,1}.data; end - idx_of_name = find(strcmpi(cond_name,model_strc.trlnames)); - idx_of_name = idx_of_name(idx_start <= idx_of_name); - idx_of_name = idx_of_name(idx_stop >= idx_of_name)- point +1; - multi(i).onsets{cond_idx}= model_strc.input.trlstart{i}(idx_of_name); - multi(i).durations{cond_idx}= durations(1:numel(idx_of_name)); end - else - multi(i).names = {'all_cond'}; - multi(i).onsets = model_strc.input.trlstart{i}; - multi(1).durations{1} = durations; + elseif manual_chosen == 2 + input_data = data_raw; + sampling_rates = [sr{:}]; + if strcmpi(options.timeunit, 'markers'), marker_data = options.marker_chan; end; end - point= point+nr_trials_in_sess; - end; - input_data = model_strc.input.scr; - sampling_rates = model_strc.input.sr; - if numel(sampling_rates) == 1 - sampling_rates = repmat(sampling_rates, n_sessions, 1); - end -end; - - -%% not all sessions have the same number of conditions -% create a new multi structure which contains all conditions and their -% timings. There are multiple cases: sessions with missing conditions and -% sessions which contain empty -% prepare timing variables -comb_onsets = {}; -comb_names = {}; -comb_durations = {}; -comb_sessions = {}; -comb_cond_nr = {}; - -% get all different conditions names in multi -if ~isempty(multi) - for iSn = 1:n_sessions - % nuber of names must always correspond with the number of onset - % arrays for a specific session - if numel(multi(iSn).names) ~= numel(multi(iSn).onsets) - str = sprintf('session %d: nr. of indicated conditions [through names] does not correspond with number of available onset-arrays',iSn); - warning('ID:invalid_input', str); - return; + elseif strcmpi(model_strc.modeltype, 'glm') + multi = model_strc.timing.multi; + input_data = model_strc.input.data; + sampling_rates = model_strc.input.sr; + filtered_sr = model_strc.input.filter.down; + else + % want to map the informations of dcm into a multi + cond_names = unique(model_strc.trlnames); + + if numel(cond_names) == numel(model_strc.trlnames) + model_strc.trlnames(:) = {'all_cond'}; + cond_names(:) = {'all_cond'}; end - for n = 1:numel(multi(iSn).names) - multi_onsets_n = multi(iSn).onsets{n}; - length_m_o_n = max(size(multi_onsets_n)); - if ~isempty(multi_onsets_n) - multi_duration_n = multi(iSn).durations{n}; - length_m_d_n = max(size(multi_duration_n)); + + point=1; + for i = 1:n_sessions + nr_trials_in_sess = size(model_strc.input.trlstart{i},1); + + min_iti = min(model_strc.input.iti{i}); + min_trl_interval = min(model_strc.input.trlstop{i} - model_strc.input.trlstart{i}); + durations(1:nr_trials_in_sess) = min_iti + min_trl_interval; + + if(numel(cond_names)>1) + multi(i).names = unique(model_strc.trlnames(point:point+nr_trials_in_sess-1))'; + % we define the segment_length as min(intertrial-interval)+ + % min(trialoffset - trialonset) + for j=1: numel(cond_names) + idx_start = point; + idx_stop = point+nr_trials_in_sess-1; + cond_name = cond_names{j}; + cond_idx = find(strcmpi(cond_name, multi(i).names)); + if isempty(cond_idx) + continue + end + idx_of_name = find(strcmpi(cond_name,model_strc.trlnames)); + idx_of_name = idx_of_name(idx_start <= idx_of_name); + idx_of_name = idx_of_name(idx_stop >= idx_of_name)- point +1; + multi(i).onsets{cond_idx}= model_strc.input.trlstart{i}(idx_of_name); + multi(i).durations{cond_idx}= durations(1:numel(idx_of_name)); + end else - multi_duration_n = []; - length_m_d_n = 0; + multi(i).names = {'all_cond'}; + multi(i).onsets = model_strc.input.trlstart{i}; + multi(1).durations{1} = durations; end - - % look for index - name_idx = find(strcmpi(comb_names, multi(iSn).names(n))); - if numel(name_idx) > 1 - warning(['Name was found multiple times, ', ... - 'will take first occurence.']); - name_idx = name_idx(1); - elseif numel(name_idx) == 0 - % append - name_idx = numel(comb_names) + 1; + point= point+nr_trials_in_sess; + end; + input_data = model_strc.input.scr; + sampling_rates = model_strc.input.sr; + if numel(sampling_rates) == 1 + sampling_rates = repmat(sampling_rates, n_sessions, 1); + end + end; + + + %% not all sessions have the same number of conditions + % create a new multi structure which contains all conditions and their + % timings. There are multiple cases: sessions with missing conditions and + % sessions which contain empty + % prepare timing variables + comb_onsets = {}; + comb_names = {}; + comb_durations = {}; + comb_sessions = {}; + comb_cond_nr = {}; + + % get all different conditions names in multi + if ~isempty(multi) + for iSn = 1:n_sessions + % nuber of names must always correspond with the number of onset + % arrays for a specific session + if numel(multi(iSn).names) ~= numel(multi(iSn).onsets) + str = sprintf('session %d: nr. of indicated conditions [through names] does not correspond with number of available onset-arrays',iSn); + warning('ID:invalid_input', str); + return; end - % add new condition name to list - if numel(comb_names) < name_idx - comb_names{name_idx} = multi(iSn).names{n}; - comb_onsets{name_idx} = multi_onsets_n; - comb_durations{name_idx} = multi_duration_n; - comb_sessions{name_idx}(1:length_m_o_n) = iSn; - comb_cond_nr{name_idx}(1:length_m_o_n) = name_idx; - elseif numel(comb_names) >= name_idx && 0 < name_idx - if isempty(comb_onsets{name_idx}) + for n = 1:numel(multi(iSn).names) + multi_onsets_n = multi(iSn).onsets{n}; + length_m_o_n = max(size(multi_onsets_n)); + if ~isempty(multi_onsets_n) + multi_duration_n = multi(iSn).durations{n}; + length_m_d_n = max(size(multi_duration_n)); + else + multi_duration_n = []; + length_m_d_n = 0; + end + + % look for index + name_idx = find(strcmpi(comb_names, multi(iSn).names(n))); + if numel(name_idx) > 1 + warning(['Name was found multiple times, ', ... + 'will take first occurence.']); + name_idx = name_idx(1); + elseif numel(name_idx) == 0 + % append + name_idx = numel(comb_names) + 1; + end + % add new condition name to list + if numel(comb_names) < name_idx + comb_names{name_idx} = multi(iSn).names{n}; comb_onsets{name_idx} = multi_onsets_n; - comb_durations{name_idx}= multi_duration_n; + comb_durations{name_idx} = multi_duration_n; comb_sessions{name_idx}(1:length_m_o_n) = iSn; comb_cond_nr{name_idx}(1:length_m_o_n) = name_idx; - else - comb_onsets{name_idx}(end+1:end+length_m_o_n) = multi_onsets_n; - comb_durations{name_idx}(end+1:end+length_m_d_n)= multi_duration_n; - comb_sessions{name_idx}(end+1:end+length_m_o_n) = iSn; - comb_cond_nr{name_idx}(end+1:end+length_m_o_n) = name_idx; + elseif numel(comb_names) >= name_idx && 0 < name_idx + if isempty(comb_onsets{name_idx}) + comb_onsets{name_idx} = multi_onsets_n; + comb_durations{name_idx}= multi_duration_n; + comb_sessions{name_idx}(1:length_m_o_n) = iSn; + comb_cond_nr{name_idx}(1:length_m_o_n) = name_idx; + else + comb_onsets{name_idx}(end+1:end+length_m_o_n) = multi_onsets_n; + comb_durations{name_idx}(end+1:end+length_m_d_n)= multi_duration_n; + comb_sessions{name_idx}(end+1:end+length_m_o_n) = iSn; + comb_cond_nr{name_idx}(end+1:end+length_m_o_n) = name_idx; + end + end - end end end -end -% number of conditions -n_cond = numel(comb_names); -segments = cell(n_cond,1); - -if options.plot - fg = figure('Name', 'Condition mean per subject', 'Visible', 'off'); - ax = axes('NextPlot', 'add'); - set(fg, 'CurrentAxes', ax); - - % load colormap - corder = get(fg, 'defaultAxesColorOrder'); - cl = length(corder); - - % legend labels - legend_lb = cell(n_cond*3,1); -end; - -%% This section gives each trial over all session a uniquie identifier. -all_sessions = cell2mat(cellfun(@(x)reshape(x, [min(size(x)), max(size(x))]),comb_sessions,'un', 0)); -all_cond_nr =cell2mat(cellfun(@(x)reshape(x, [min(size(x)), max(size(x))]),comb_cond_nr,'un', 0)); -all_onsets = cell2mat(cellfun(@(x)reshape(x, [min(size(x)), max(size(x))]),comb_onsets,'un', 0)); -all_dur = cell2mat(cellfun(@(x)reshape(x, [min(size(x)), max(size(x))]),comb_durations,'un', 0)); -all_sess_ons =[all_onsets' , all_sessions']; -%all_sess_ons_cond = [all_onsets' , all_sessions', all_cond_nr']; -sorted_session = sortrows(all_sess_ons,[2 1]); - -% find idx. the function throws a warning if a specific condition and a -% specific session contains multiple identical onsets -sorted_idx(1:size(all_cond_nr,2)) = 0; -for k = 1: size(all_cond_nr,2) - a = all_sess_ons(k,:); - b = find(all(a == sorted_session,2)); - nr_found = numel(b); - if sorted_idx(k)~=0 - continue; - elseif nr_found ~=1 - warning(sprintf('Condition nr. %d in session %d contains multiple identical onsets. The segment will hold identical trials.',a(2),all_cond_nr(k))); - idx_found = all(a == all_sess_ons,2); - sorted_idx(idx_found)= b; - else - sorted_idx(k)= b; + % number of conditions + n_cond = numel(comb_names); + segments = cell(n_cond,1); + + if options.plot + fg = figure('Name', 'Condition mean per subject', 'Visible', 'off'); + ax = axes('NextPlot', 'add'); + set(fg, 'CurrentAxes', ax); + + % load colormap + corder = get(fg, 'defaultAxesColorOrder'); + cl = length(corder); + + % legend labels + legend_lb = cell(n_cond*3,1); + end; + + %% This section gives each trial over all session a uniquie identifier. + all_sessions = cell2mat(cellfun(@(x)reshape(x, [min(size(x)), max(size(x))]),comb_sessions,'un', 0)); + all_cond_nr =cell2mat(cellfun(@(x)reshape(x, [min(size(x)), max(size(x))]),comb_cond_nr,'un', 0)); + all_onsets = cell2mat(cellfun(@(x)reshape(x, [min(size(x)), max(size(x))]),comb_onsets,'un', 0)); + all_dur = cell2mat(cellfun(@(x)reshape(x, [min(size(x)), max(size(x))]),comb_durations,'un', 0)); + all_sess_ons =[all_onsets' , all_sessions']; + %all_sess_ons_cond = [all_onsets' , all_sessions', all_cond_nr']; + sorted_session = sortrows(all_sess_ons,[2 1]); + + % find idx. the function throws a warning if a specific condition and a + % specific session contains multiple identical onsets + sorted_idx(1:size(all_cond_nr,2)) = 0; + for k = 1: size(all_cond_nr,2) + a = all_sess_ons(k,:); + b = find(all(a == sorted_session,2)); + nr_found = numel(b); + if sorted_idx(k)~=0 + continue; + elseif nr_found ~=1 + warning(sprintf('Condition nr. %d in session %d contains multiple identical onsets. The segment will hold identical trials.',a(2),all_cond_nr(k))); + idx_found = all(a == all_sess_ons,2); + sorted_idx(idx_found)= b; + else + sorted_idx(k)= b; + end + + end + all_sess_ons_cond_idx = [all_onsets' , all_sessions', all_cond_nr',sorted_idx']; + for i=1:n_cond + segments{i}.trial_idx = all_sess_ons_cond_idx(all_sess_ons_cond_idx(:,3) == i, 4); end -end -all_sess_ons_cond_idx = [all_onsets' , all_sessions', all_cond_nr',sorted_idx']; -for i=1:n_cond - segments{i}.trial_idx = all_sess_ons_cond_idx(all_sess_ons_cond_idx(:,3) == i, 4); -end - -n_onsets_in_cond = {}; -for c = 1:n_cond - n_onsets_in_cond{c} = sum(all_cond_nr == c); -end - -% TODO: Create three different versions of this function instead of branching all the time? -% IMO there are enough different data loading and processing logic that should separate these -% methods to different functions. -%% save data in segments -num_prev_conds = 0; -onsets = {}; -durations = {}; -for i = 1:n_sessions - for j = 1:numel(multi(i).onsets) - onsets{end + 1} = multi(i).onsets{j}; - durations{end + 1} = multi(i).durations{j}; + n_onsets_in_cond = {}; + for c = 1:n_cond + n_onsets_in_cond{c} = sum(all_cond_nr == c); end -end -for session_idx = 1:n_sessions - sr = sampling_rates(session_idx); - % load data - session_data = input_data{session_idx}; - if manual_chosen == 1 && strcmpi(options.timeunit, 'markers') - marker = marker_data{session_idx}; + + % TODO: Create three different versions of this function instead of branching all the time? + % IMO there are enough different data loading and processing logic that should separate these + % methods to different functions. + %% save data in segments + num_prev_conds = 0; + onsets = {}; + durations = {}; + for i = 1:n_sessions + for j = 1:numel(multi(i).onsets) + onsets{end + 1} = multi(i).onsets{j}; + durations{end + 1} = multi(i).durations{j}; + end end - num_conds_in_session = numel(multi(session_idx).names); - for c = 1:num_conds_in_session - cond_idx = find(strcmpi(comb_names, multi(session_idx).names{c})); - all_onset_sessions_in_cond = all_sess_ons_cond_idx(all_sess_ons_cond_idx(:, 3) == cond_idx, 2); - onset_write_indices_in_cond_and_session = find(all_onset_sessions_in_cond == session_idx); - - idx_to_timing = num_prev_conds + c; - onsets_cond = onsets{idx_to_timing}; - durations_cond = durations{idx_to_timing}; - num_onsets = numel(onsets_cond); - assert(numel(onset_write_indices_in_cond_and_session) == num_onsets); - - for onset_idx = 1:num_onsets - if options.length <= 0 - try - segment_length = durations_cond(onset_idx); - if segment_length==0 - warning('ID:invalid_input', 'Cannot determine onset duration. Durations is set to 0.'); return; - end - catch - warning('ID:invalid_input', 'Cannot determine onset duration.'); return; + for session_idx = 1:n_sessions + sr = sampling_rates(session_idx); + % load data + session_data = input_data{session_idx}; + if manual_chosen ~= 0 && strcmpi(options.timeunit, 'markers') + marker = marker_data{session_idx}; + end + num_conds_in_session = numel(multi(session_idx).names); + for c = 1:num_conds_in_session + cond_idx = find(strcmpi(comb_names, multi(session_idx).names{c})); + all_onset_sessions_in_cond = all_sess_ons_cond_idx(all_sess_ons_cond_idx(:, 3) == cond_idx, 2); + onset_write_indices_in_cond_and_session = find(all_onset_sessions_in_cond == session_idx); + + idx_to_timing = num_prev_conds + c; + onsets_cond = onsets{idx_to_timing}; + durations_cond = durations{idx_to_timing}; + num_onsets = numel(onsets_cond); + assert(numel(onset_write_indices_in_cond_and_session) == num_onsets); + + for onset_idx = 1:num_onsets + if options.length <= 0 + try + segment_length = durations_cond(onset_idx); + if segment_length==0 + warning('ID:invalid_input', 'Cannot determine onset duration. Durations is set to 0.'); return; + end + catch + warning('ID:invalid_input', 'Cannot determine onset duration.'); return; + end; + else + segment_length = options.length; end; - else - segment_length = options.length; - end; - - % ensure start and segment_length have the 'sample' format to - % access on data - start = onsets_cond(onset_idx); - switch options.timeunit - case 'seconds' - segment_length = segment_length*sr; - start = start * sr; - case 'markers' - segment_length = segment_length*sr; - if manual_chosen == 1 - start = marker(start) * sr; - else + + % ensure start and segment_length have the 'sample' format to + % access on data + start = onsets_cond(onset_idx); + switch options.timeunit + case 'seconds' + segment_length = segment_length*sr; start = start * sr; - end - assert(~strcmpi(model_strc.modeltype, 'dcm')); - case 'samples' - start = start * sr / filtered_sr; - end; - - start = max(1, round(start)); - stop = min(numel(session_data) + 1, start + round(segment_length)); - % % set stop - % stop = start + segment_length; - % - % % ensure start and stop have the correct format - % start = max(1,round(start)); - % stop = min(numel(session_data), round(stop)); - - if ~isfield(segments{cond_idx}, 'data') - segments{cond_idx}.data = NaN((stop-start), n_onsets_in_cond{cond_idx}); + case 'markers' + segment_length = segment_length*sr; + if manual_chosen ~= 0 + start = marker(start) * sr; + else + start = start * sr; + assert(~strcmpi(model_strc.modeltype, 'dcm')); + end + case 'samples' + if manual_chosen ~= 0 + start = start; + else + start = start * sr / filtered_sr; + end; + end; + + start = max(1, round(start)); + stop = min(numel(session_data) + 1, start + round(segment_length)); + % % set stop + % stop = start + segment_length; + % + % % ensure start and stop have the correct format + % start = max(1,round(start)); + % stop = min(numel(session_data), round(stop)); + + if ~isfield(segments{cond_idx}, 'data') + segments{cond_idx}.data = NaN((stop-start), n_onsets_in_cond{cond_idx}); + end; + if (stop - start) > size(segments{cond_idx}.data, 1) + last_row = size(segments{cond_idx}.data, 1); + segments{cond_idx}.data(last_row + 1 : (stop - start), :) = NaN; + end + + onset_write_idx = onset_write_indices_in_cond_and_session(onset_idx); + segments{cond_idx}.data(1:(stop-start), onset_write_idx) = session_data(start:(stop-1)); end; - if (stop - start) > size(segments{cond_idx}.data, 1) - last_row = size(segments{cond_idx}.data, 1); - segments{cond_idx}.data(last_row + 1 : (stop - start), :) = NaN; - end - - onset_write_idx = onset_write_indices_in_cond_and_session(onset_idx); - segments{cond_idx}.data(1:(stop-start), onset_write_idx) = session_data(start:(stop-1)); end; + num_prev_conds = num_prev_conds + num_conds_in_session; end; - num_prev_conds = num_prev_conds + num_conds_in_session; -end; - -%% create statistics for each condition -for c=1:n_cond - m = segments{c}.data; - segments{c}.name = comb_names{c}; - % create mean - segments{c}.mean = nanmean(m,2); - - segments{c}.std = nanstd(m,0,2); - segments{c}.sem = segments{c}.std./sqrt(n_onsets_in_cond{c}); - segments{c}.trial_nan_percent = sum(isnan(m))/size(m,1); - segments{c}.total_nan_percent = sum(sum(isnan(m)))/numel(m); - % segments{c}.total_nan_percent = mean(segments{c}.trial_nan_percent); - - - sr = sampling_rates(1); % TODO: assuming sampling rates in all sessions are equal? - segments{c}.t = linspace(sr^-1, numel(segments{c}.mean)/sr, numel(segments{c}.mean))'; - %% create plot per condition - if options.plot - p = plot(ax, segments{c}.t, segments{c}.mean, '-', ... - segments{c}.t, segments{c}.mean + segments{c}.sem, '-', ... - segments{c}.t, segments{c}.mean - segments{c}.sem, '-'); - % correct colors - color = corder(mod(c,cl) + 1, :); - set(p(1), 'LineWidth', 2, 'Color', color); - set(p(2), 'Color', color); - set(p(3), 'Color', color); + + %% create statistics for each condition + for c=1:n_cond + m = segments{c}.data; + segments{c}.name = comb_names{c}; + % create mean + segments{c}.mean = nanmean(m,2); + + segments{c}.std = nanstd(m,0,2); + segments{c}.sem = segments{c}.std./sqrt(n_onsets_in_cond{c}); + segments{c}.trial_nan_percent = sum(isnan(m))/size(m,1); + segments{c}.total_nan_percent = sum(sum(isnan(m)))/numel(m); + % segments{c}.total_nan_percent = mean(segments{c}.trial_nan_percent); + - legend_lb{(c-1)*3 + 1} = [comb_names{c} ' AVG']; - legend_lb{(c-1)*3 + 2} = [comb_names{c} ' SEM+']; - legend_lb{(c-1)*3 + 3} = [comb_names{c} ' SEM-']; + sr = sampling_rates(1); % TODO: assuming sampling rates in all sessions are equal? + segments{c}.t = linspace(sr^-1, numel(segments{c}.mean)/sr, numel(segments{c}.mean))'; + %% create plot per condition + if options.plot + p = plot(ax, segments{c}.t, segments{c}.mean, '-', ... + segments{c}.t, segments{c}.mean + segments{c}.sem, '-', ... + segments{c}.t, segments{c}.mean - segments{c}.sem, '-'); + % correct colors + color = corder(mod(c,cl) + 1, :); + set(p(1), 'LineWidth', 2, 'Color', color); + set(p(2), 'Color', color); + set(p(3), 'Color', color); + + legend_lb{(c-1)*3 + 1} = [comb_names{c} ' AVG']; + legend_lb{(c-1)*3 + 2} = [comb_names{c} ' SEM+']; + legend_lb{(c-1)*3 + 3} = [comb_names{c} ' SEM-']; + end; end; -end; - -%% nan_output -if ~strcmpi(options.nan_output,'none') - %count number of trials - trials_nr_per_cond = cellfun(@(x) size(x.trial_idx,1),segments,'un',0); - trials_nr = cell2mat(trials_nr_per_cond); - trials_nr_sum = sum(trials_nr); - - %create matix with values - trials_nan(1:(trials_nr_sum+1),1:n_cond) = NaN; - for i=1:n_cond - %nan_idx_length = trials_nr(i); - nan_idx_length = size(segments{i}.trial_idx,1); - for j = 1:nan_idx_length - nan_perc = segments{i}.trial_nan_percent(j); - trials_nan(segments{i}.trial_idx(j),i) = nan_perc; + + %% nan_output + if ~strcmpi(options.nan_output,'none') + %count number of trials + trials_nr_per_cond = cellfun(@(x) size(x.trial_idx,1),segments,'un',0); + trials_nr = cell2mat(trials_nr_per_cond); + trials_nr_sum = sum(trials_nr); + + %create matix with values + trials_nan(1:(trials_nr_sum+1),1:n_cond) = NaN; + for i=1:n_cond + %nan_idx_length = trials_nr(i); + nan_idx_length = size(segments{i}.trial_idx,1); + for j = 1:nan_idx_length + nan_perc = segments{i}.trial_nan_percent(j); + trials_nan(segments{i}.trial_idx(j),i) = nan_perc; + end + trials_nan(trials_nr_sum+1,i) = segments{i}.total_nan_percent; + end + + %define names of rows in table + r_names = strsplit(num2str(1:trials_nr_sum)); + r_names{end+1} = 'total'; + %valriable Names + var_names = cellfun(@(x)regexprep( x, '[+]' , '_plus'), comb_names, 'un',0); + var_names = cellfun(@(x)regexprep( x, '[-]' , '_minus'), var_names, 'un',0); + var_names = cellfun(@(x)regexprep( x, '[^a-zA-Z0-9]' , '_'), var_names, 'un',0); + %create table with the right format + trials_nan_output = array2table(trials_nan,'VariableNames', var_names, 'RowNames', r_names'); + switch options.nan_output + case 'screen' + fprintf(['\nThe following tabel shows for each condition the NaN-ratio ',... + 'in the different trials.\nA NaN-value in the table indicates ',... + 'that a trial does not correspond to the condition.\n',... + 'The last value indicates the average Nan-ratio over all trials ',... + 'belonging to this condition.\n\n']); + disp(trials_nan_output); + case 'none' + otherwise + %print Nan-Value in file + %expect the path to file in options.nan_output + %find information about file + [path, name, ext ]= fileparts(options.nan_output); + + %if the file already exists, we overwrite the file with the + %data. Otherwise we create a new file and save the data + % new_file_base = sprintf('%s.csv', name); + new_file_base = sprintf('%s.txt', name); + output_file = fullfile(path,new_file_base); + fprintf(['\nThe table in file (%s)shows for each condition the NaN-ratio ',... + 'in the different trials.\nA NaN-value in the table indicates ',... + 'that a trial does not correspond to the condition.\n',... + 'The last value indicates the average Nan-ratio over all trials ',... + 'belonging to this condition.\n\n'],new_file_base); + writetable(trials_nan_output, output_file,'WriteRowNames', true ,'Delimiter', '\t'); + + end - trials_nan(trials_nr_sum+1,i) = segments{i}.total_nan_percent; end + %% set output and save segments into file + out.segments = segments; - %define names of rows in table - r_names = strsplit(num2str(1:trials_nr_sum)); - r_names{end+1} = 'total'; - %valriable Names - var_names = cellfun(@(x)regexprep( x, '[+]' , '_plus'), comb_names, 'un',0); - var_names = cellfun(@(x)regexprep( x, '[-]' , '_minus'), var_names, 'un',0); - var_names = cellfun(@(x)regexprep( x, '[^a-zA-Z0-9]' , '_'), var_names, 'un',0); - %create table with the right format - trials_nan_output = array2table(trials_nan,'VariableNames', var_names, 'RowNames', r_names'); - switch options.nan_output - case 'screen' - fprintf(['\nThe following tabel shows for each condition the NaN-ratio ',... - 'in the different trials.\nA NaN-value in the table indicates ',... - 'that a trial does not correspond to the condition.\n',... - 'The last value indicates the average Nan-ratio over all trials ',... - 'belonging to this condition.\n\n']); - disp(trials_nan_output); - case 'none' - otherwise - %print Nan-Value in file - %expect the path to file in options.nan_output - %find information about file - [path, name, ext ]= fileparts(options.nan_output); - - %if the file already exists, we overwrite the file with the - %data. Otherwise we create a new file and save the data - % new_file_base = sprintf('%s.csv', name); - new_file_base = sprintf('%s.txt', name); - output_file = fullfile(path,new_file_base); - fprintf(['\nThe table in file (%s)shows for each condition the NaN-ratio ',... - 'in the different trials.\nA NaN-value in the table indicates ',... - 'that a trial does not correspond to the condition.\n',... - 'The last value indicates the average Nan-ratio over all trials ',... - 'belonging to this condition.\n\n'],new_file_base); - writetable(trials_nan_output, output_file,'WriteRowNames', true ,'Delimiter', '\t'); - - - end -end -%% set output and save segments into file -out.segments = segments; - -if ~isempty(options.outputfile) - % ensure correct file suffix - [pt, fn, ~] = fileparts(options.outputfile); - outfile = [pt filesep fn '.mat']; - write_ok = 0; - if exist(outfile, 'file') - if options.overwrite + if ~isempty(options.outputfile) + % ensure correct file suffix + [pt, fn, ~] = fileparts(options.outputfile); + outfile = [pt filesep fn '.mat']; + write_ok = 0; + if exist(outfile, 'file') + if options.overwrite + write_ok = 1; + else + button = questdlg(sprintf('File (%s) already exists. Replace file?', ... + outfile), 'Replace file?', 'Yes', 'No', 'No'); + + write_ok = strcmpi(button, 'Yes'); + end; + else write_ok = 1; - elseif ~options.dont_ask_overwrite - button = questdlg(sprintf('File (%s) already exists. Replace file?', ... - outfile), 'Replace file?', 'Yes', 'No', 'No'); - - write_ok = strcmpi(button, 'Yes'); end; - else - write_ok = 1; + + if write_ok + save(outfile, 'segments'); + out.outputfile = outfile; + end; end; - if write_ok - save(outfile, 'segments'); - out.outputfile = outfile; + if options.plot + % show plot + set(fg, 'Visible', 'on'); + legend(legend_lb); end; -end; - -if options.plot - % show plot - set(fg, 'Visible', 'on'); - legend(legend_lb); -end; - -sts = 1; + + sts = 1; + \ No newline at end of file diff --git a/src/pspm_get_acq.m b/src/pspm_get_acq.m index acb9d092b..542893e55 100644 --- a/src/pspm_get_acq.m +++ b/src/pspm_get_acq.m @@ -19,7 +19,7 @@ global settings; if isempty(settings), pspm_init; end; sourceinfo = []; sts = -1; -addpath([settings.path, 'Import', filesep, 'acq']); +addpath(pspm_path('Import','acq')); % load data but suppress output @@ -66,7 +66,7 @@ % clear path and return % ------------------------------------------------------------------------- -rmpath([settings.path, 'Import', filesep, 'acq']); +rmpath(pspm_path('Import','acq')); sts = 1; return; diff --git a/src/pspm_get_biosemi.m b/src/pspm_get_biosemi.m index 78a6f67d7..8fa7d95a2 100644 --- a/src/pspm_get_biosemi.m +++ b/src/pspm_get_biosemi.m @@ -16,7 +16,7 @@ % ------------------------------------------------------------------------- global settings; if isempty(settings), pspm_init; end; -addpath([settings.path, 'Import', filesep, 'fieldtrip', filesep, 'fileio']); +addpath(pspm_path('Import','fieldtrip','fileio')); sourceinfo = []; sts = -1; % get external file, using fieldtrip @@ -69,7 +69,7 @@ % clear path and return % ------------------------------------------------------------------------- -rmpath([settings.path, 'Import', filesep, 'fieldtrip', filesep, 'fileio']); +rmpath(pspm_path('Import','fieldtrip','fileio')); sts = 1; return; diff --git a/src/pspm_get_brainvis.m b/src/pspm_get_brainvis.m index a1a355e0f..b8db19987 100644 --- a/src/pspm_get_brainvis.m +++ b/src/pspm_get_brainvis.m @@ -21,7 +21,7 @@ global settings; if isempty(settings), pspm_init; end; sourceinfo = []; sts = -1; -addpath([settings.path, 'Import', filesep, 'fieldtrip' filesep 'fileio']); +addpath(pspm_path('Import','fieldtrip','fileio')); % get data % ------------------------------------------------------------------------- @@ -81,7 +81,7 @@ % clear path and return % ------------------------------------------------------------------------- -rmpath([settings.path, 'Import', filesep, 'fieldtrip', filesep, 'fileio']); +rmpath(pspm_path('Import','fieldtrip','fileio')); sts = 1; return; diff --git a/src/pspm_get_cnt.m b/src/pspm_get_cnt.m index 1f59f43aa..ad8c6b87a 100644 --- a/src/pspm_get_cnt.m +++ b/src/pspm_get_cnt.m @@ -18,7 +18,7 @@ % ------------------------------------------------------------------------- global settings; if isempty(settings), pspm_init; end; -addpath([settings.path, 'Import', filesep, 'fieldtrip', filesep, 'fileio']); +addpath(pspm_path('Import','fieldtrip','fileio')); sourceinfo = []; sts = -1; % get external file, using fieldtrip @@ -76,7 +76,7 @@ % clear path and return % ------------------------------------------------------------------------- -rmpath([settings.path, 'Import', filesep, 'fieldtrip', filesep, 'fileio']); +rmpath(pspm_path('Import','fieldtrip','fileio')); sts = 1; return; diff --git a/src/pspm_get_edf.m b/src/pspm_get_edf.m index 3cb6a82ec..54429bce1 100644 --- a/src/pspm_get_edf.m +++ b/src/pspm_get_edf.m @@ -14,7 +14,7 @@ global settings; if isempty(settings), pspm_init; end; sourceinfo = []; sts = -1; -addpath([settings.path, 'Import', filesep, 'fieldtrip' filesep 'fileio']); +addpath(pspm_path('Import','fieldtrip','fileio')); % get data % ------------------------------------------------------------------------- @@ -73,6 +73,6 @@ % clear path and return % ------------------------------------------------------------------------- -rmpath([settings.path, 'Import', filesep, 'fieldtrip' filesep 'fileio']); +rmpath(pspm_path('Import','fieldtrip','fileio')); sts = 1; return; diff --git a/src/pspm_get_events.m b/src/pspm_get_events.m index 13411ec06..aefb0f5d9 100644 --- a/src/pspm_get_events.m +++ b/src/pspm_get_events.m @@ -6,7 +6,7 @@ % .marker ('timestamps', 'continuous') % .sr (timestamps: timeunits in seconds, continuous: sample rate in 1/seconds) % and optional field -% .flank ('ascending', 'descending', 'both': optional field for +% .flank ('ascending', 'descending', 'both', 'all': optional field for % continuous channels; default: both) % returns event timestamps in seconds in import.data %__________________________________________________________________________ @@ -81,6 +81,10 @@ fprintf('\n'); warning('No markers, or problem with TTL channel.'); import.data = []; + elseif isfield(import,'flank') && strcmpi(import.flank, 'all') + allMrk = find(import.data); + import.data = allMrk./import.sr; + mPos = allMrk+3; elseif isfield(import, 'flank') && strcmpi(import.flank, 'ascending') import.data = lo2hi./import.sr; mPos = lo2hi+3; diff --git a/src/pspm_get_eyelink.m b/src/pspm_get_eyelink.m index 02597621d..329671989 100644 --- a/src/pspm_get_eyelink.m +++ b/src/pspm_get_eyelink.m @@ -65,8 +65,7 @@ if isempty(settings), pspm_init; end sourceinfo = []; sts = -1; % add specific import path for specific import function - addpath([settings.path, 'Import', filesep, 'eyelink']); - + addpath(pspm_path('Import','eyelink')); default_blink_saccade_discard_factor = 0; for i = 1:numel(import) if ~isfield(import{i}, 'blink_saccade_edge_discard_factor') @@ -257,8 +256,8 @@ % imported data cannot be read at the moment (in later instances) import{k}.markerinfo = markerinfos; - % use ascending flank for translation from continuous to events - import{k}.flank = 'ascending'; + % use 'all' flank for translation from continuous to events + import{k}.flank = 'all'; else % determine chan id from chantype - eyelink specific % thats why channel ids will be ignored! @@ -405,7 +404,7 @@ sourceinfo.best_eye = lower(sourceinfo.eyesObserved(min_idx)); % remove specific import path - rmpath([settings.path, 'Import', filesep, 'eyelink']); + rmpath(pspm_path('Import','eyelink')); sts = 1; return; diff --git a/src/pspm_get_labchart.m b/src/pspm_get_labchart.m index cbf69704d..144d35564 100644 --- a/src/pspm_get_labchart.m +++ b/src/pspm_get_labchart.m @@ -23,8 +23,7 @@ % add path % ------------------------------------------------------------------------- -addpath([settings.path, 'Import', filesep, 'labchart' filesep 'adi']); - +addpath(pspm_path('Import','labchart','adi')); % load & check data % ------------------------------------------------------------------------- [labchart] = adi.readFile(datafile); @@ -121,5 +120,5 @@ delete(labchart.file_h); % clear path and return % ------------------------------------------------------------------------- -rmpath([settings.path, 'Import', filesep, 'labchart' filesep 'adi']); +rmpath(pspm_path('Import','labchart','adi')); sts = 1; diff --git a/src/pspm_get_physlog.m b/src/pspm_get_physlog.m index 9928ba535..ba75d48b2 100644 --- a/src/pspm_get_physlog.m +++ b/src/pspm_get_physlog.m @@ -42,7 +42,7 @@ if isempty(settings), pspm_init; end; sourceinfo = []; sts = -1; % add specific import path for specific import function -addpath([settings.path, 'Import', filesep, 'physlog']); +addpath(pspm_path('Import','physlog')); % load data with specific function % ------------------------------------------------------------------------- @@ -76,7 +76,7 @@ sourceinfo.time = out.record_time; % remove specific import path -rmpath([settings.path, 'Import', filesep, 'physlog']); +rmpath(pspm_path('Import','physlog')); sts = 1; return; \ No newline at end of file diff --git a/src/pspm_get_smi.m b/src/pspm_get_smi.m index 46d769201..217dc758c 100644 --- a/src/pspm_get_smi.m +++ b/src/pspm_get_smi.m @@ -82,7 +82,7 @@ global settings; if isempty(settings), pspm_init; end sourceinfo = []; sts = -1; - addpath([settings.path, 'Import', filesep, 'smi']); + addpath(pspm_path('Import','smi')); if ~iscell(import) import = {import}; @@ -200,7 +200,7 @@ sourceinfo.eyes_observed = eyes_observed; sourceinfo.best_eye = eye_with_smaller_nan_ratio(import, eyes_observed); - rmpath([settings.path, 'Import', filesep, 'smi']); + rmpath(pspm_path('Import','smi')); sts = 1; end diff --git a/src/pspm_get_spike.m b/src/pspm_get_spike.m index 8ae374118..645c14b43 100644 --- a/src/pspm_get_spike.m +++ b/src/pspm_get_spike.m @@ -17,7 +17,7 @@ global settings; if isempty(settings), pspm_init; end; sourceinfo = []; sts = -1; -addpath([settings.path, 'Import', filesep, 'SON']); +addpath(pspm_path('Import','SON')); % get external file, using SON library % ------------------------------------------------------------------------- @@ -127,6 +127,6 @@ % clear path and return % ------------------------------------------------------------------------- -rmpath([settings.path, 'Import', filesep, 'SON']); +rmpath(pspm_path('Import','SON')); sts = 1; return; diff --git a/src/pspm_get_vario.m b/src/pspm_get_vario.m index 1e438e083..bae2b1a10 100644 --- a/src/pspm_get_vario.m +++ b/src/pspm_get_vario.m @@ -20,7 +20,7 @@ global settings; if isempty(settings), pspm_init; end; sourceinfo = []; sts = -1; -addpath([settings.path, 'Import', filesep, 'vario']); +addpath(pspm_path('Import','vario')); % get data % ------------------------------------------------------------------------- @@ -63,7 +63,7 @@ % clear path and return % ------------------------------------------------------------------------- -rmpath([settings.path, 'Import', filesep, 'vario']); +rmpath(pspm_path('Import','vario')); sts = 1; return; diff --git a/src/pspm_get_viewpoint.m b/src/pspm_get_viewpoint.m index fd4f6852b..e2bbdd2dc 100644 --- a/src/pspm_get_viewpoint.m +++ b/src/pspm_get_viewpoint.m @@ -71,7 +71,7 @@ global settings; if isempty(settings), pspm_init; end sourceinfo = []; sts = -1; - addpath([settings.path, 'Import', filesep, 'viewpoint']); + addpath(pspm_path('Import','viewpoint')); if ~iscell(import) import = {import}; @@ -169,7 +169,7 @@ sourceinfo.eyesObserved = eyes_observed; sourceinfo.best_eye = eye_with_smaller_nan_ratio(import, eyes_observed); - rmpath([settings.path, 'Import', filesep, 'viewpoint']); + rmpath(pspm_path('Import','viewpoint')); sts = 1; end diff --git a/src/pspm_get_wdq.m b/src/pspm_get_wdq.m index 993aa6eea..b540a716d 100644 --- a/src/pspm_get_wdq.m +++ b/src/pspm_get_wdq.m @@ -17,7 +17,7 @@ global settings; if isempty(settings), pspm_init; end; sourceinfo = []; sts = -1; -addpath([settings.path, 'Import', filesep, 'wdq']); +addpath(pspm_path('Import','wdq')); % get external file, using Dataq functions % ------------------------------------------------------------------------- @@ -42,7 +42,7 @@ % clear path and return % ------------------------------------------------------------------------- -rmpath([settings.path, 'Import', filesep, 'wdq']); +rmpath(pspm_path('Import','wdq')); sts = 1; return; diff --git a/src/pspm_get_wdq_n.m b/src/pspm_get_wdq_n.m index 7145ce083..4a0cb6375 100644 --- a/src/pspm_get_wdq_n.m +++ b/src/pspm_get_wdq_n.m @@ -23,7 +23,7 @@ global settings; if isempty(settings), pspm_init; end; sourceinfo = []; sts = -1; -addpath([settings.path, 'Import', filesep, 'nwdq']); +addpath(pspm_path('Import','nwdq')); % get external file, using Dataq functions % ------------------------------------------------------------------------- @@ -48,7 +48,7 @@ % clear path and return % ------------------------------------------------------------------------- -rmpath([settings.path, 'Import', filesep, 'nwdq']); +rmpath(pspm_path('Import','nwdq')); sts = 1; return; diff --git a/src/pspm_init.m b/src/pspm_init.m index fc4259fb5..ef371a1e1 100644 --- a/src/pspm_init.m +++ b/src/pspm_init.m @@ -123,7 +123,7 @@ addspm=1; end if addspm - addpath([pth, fs, 'SPM']); + addpath(pspm_path('ext','SPM')); spmpath=1; else spmpath=0; @@ -132,7 +132,7 @@ % check whether matlabbatch is already on path dummy=which('cfg_ui'); if isempty (dummy) - addpath([pth, fs, 'matlabbatch']); + addpath(pspm_path('ext','matlabbatch')); matlabbatchpath=1; else if strcmp(fs, '/') @@ -155,7 +155,7 @@ [config_dir,~,~] = fileparts(dummy); rmpath(config_dir); end - addpath([pth, fs, 'matlabbatch']); + addpath(pspm_path('ext','matlabbatch')); matlabbatchpath=1; else matlabbatchpath=0; @@ -168,16 +168,16 @@ % check whether pspm_cfg is already on path dummy=which('pspm_cfg'); if isempty (dummy) - addpath([pth, fs, 'pspm_cfg']); + addpath(pspm_path('pspm_cfg')); scrcfgpath=1; else scrcfgpath=0; end % add VBA because this is used in various functions -addpath([pth, 'VBA']); -addpath([pth, 'VBA', fs, 'subfunctions']); -addpath([pth, 'VBA', fs, 'stats&plots']); +addpath(pspm_path('ext','VBA')); +addpath(pspm_path('ext','VBA','subfunctions')); +addpath(pspm_path('ext','VBA','stats&plots')); % ------------------------------------------------------------------------- diff --git a/src/pspm_msg.txt b/src/pspm_msg.txt index 00b3cbc61..888f1989f 100644 --- a/src/pspm_msg.txt +++ b/src/pspm_msg.txt @@ -1,7 +1,7 @@ $___________________________________________________________________________ Welcome to PsPM - PsychoPhysiological Modelling (incorporating SCRalyze) -Version 4.2.1 (04.11.2019) +Version 4.3.0 (25.03.2020) $ ------------------------------------------ (c) 2008-2019 diff --git a/src/pspm_pupil_pp.m b/src/pspm_pupil_pp.m index 6ab67ff59..dde781ad5 100644 --- a/src/pspm_pupil_pp.m +++ b/src/pspm_pupil_pp.m @@ -279,7 +279,7 @@ % load lib % ------------------------------------------------------------------------- - libbase_path = pspm_path('pupil-size', 'code'); + libbase_path = pspm_path('ext','pupil-size', 'code'); libpath = {fullfile(libbase_path, 'dataModels'), fullfile(libbase_path, 'helperFunctions')}; addpath(libpath{:}); diff --git a/src/pspm_pupil_pp_options.m b/src/pspm_pupil_pp_options.m index a4ef55160..fe033b44d 100644 --- a/src/pspm_pupil_pp_options.m +++ b/src/pspm_pupil_pp_options.m @@ -149,7 +149,7 @@ if isempty(settings), pspm_init; end sts = -1; - libbase_path = fullfile(fileparts(which('pspm_pupil_pp_options')), 'pupil-size', 'code'); + libbase_path = pspm_path('ext','pupil-size', 'code'); libpath = {fullfile(libbase_path, 'dataModels'), fullfile(libbase_path, 'helperFunctions')}; addpath(libpath{:}); diff --git a/src/pspm_quit.m b/src/pspm_quit.m index efd6bbca5..a2973f0c0 100644 --- a/src/pspm_quit.m +++ b/src/pspm_quit.m @@ -1,6 +1,6 @@ % pspm_quit clears settings, removes paths & closes figures %__________________________________________________________________________ -% PsPM 4.2.1 +% PsPM 4.3.0 % (C) 2008-2019 Dominik R Bach (Wellcome Trust Centre for Neuroimaging) % % $Id: pspm_quit.m 805 2019-09-16 07:12:08Z esrefo $ @@ -21,10 +21,10 @@ fs = filesep; if settings.scrpath, rmpath(settings.path), end; -if any(contains(settings.path, 'VBA')) - rmpath([settings.path, 'VBA']); - rmpath([settings.path, 'VBA', fs, 'subfunctions']); - rmpath([settings.path, 'VBA', fs, 'stats&plots']); +if any(contains(path, 'VBA')) + rmpath(pspm_path('ext','VBA')); + rmpath(pspm_path('ext','VBA','subfunctions')); + rmpath(pspm_path('ext','VBA','stats&plots')); end clear settings @@ -33,6 +33,6 @@ disp(' '); disp('Thanks for using PsPM.'); disp('_____________________________________________________________________________________________'); -disp('PsPM 4.2.1 (c) 2008-2019 Dominik R. Bach'); +disp('PsPM 4.3.0 (c) 2008-2019 Dominik R. Bach'); disp('University of Zurich, CH -- University College London, UK'); diff --git a/src/pspm_version.m b/src/pspm_version.m index 86701de27..8f233947f 100644 --- a/src/pspm_version.m +++ b/src/pspm_version.m @@ -40,7 +40,7 @@ switch varargin{1} case 'check' % check for updates try - str = webread('http://pspm.sourceforge.net/'); + str = webread('https://bachlab.github.io/PsPM/'); begidx = strfind(str, 'Current version'); endidx = begidx + strfind(str(begidx : end), sprintf('\n')); endidx = endidx(1); diff --git a/test/pspm_extract_segments_test.m b/test/pspm_extract_segments_test.m index d31241e0c..ad8feeb6c 100644 --- a/test/pspm_extract_segments_test.m +++ b/test/pspm_extract_segments_test.m @@ -181,7 +181,8 @@ function invalid_input(this) this.verifyWarning(@() pspm_extract_segments('manual',fn,0), 'ID:invalid_input'); % wrong input elements - this.verifyWarning(@() pspm_extract_segments('manual',[0.1,2],0,timing), 'ID:invalid_input'); + this.verifyWarning(@() pspm_extract_segments('manual',struct('a',10),0,timing), 'ID:invalid_input'); + this.verifyWarning(@() pspm_extract_segments('manual',[1,3],logical(32),timing), 'ID:invalid_input'); this.verifyWarning(@() pspm_extract_segments('manual',fn,'a',timing), 'ID:invalid_input'); this.verifyWarning(@() pspm_extract_segments('manual',fn,{'a'},timing), 'ID:invalid_input');