Hi everybody ! Many users had problems running examples in newer Matlab versions. The issue is commonly caused by the readannot MEX compiled binary. Although this readannot.c should be compiled during installation, some newer Matlab versions have strong dependencies on certain compilers. In the following example, release 2017 only accepts gcc and g++ version 4.9. So make sure to recompile ecg-kit/common/*.c before asking for help.
Since Matlab 2017 is only compatible with GNU compilers <= 4.9, to avoid problems make sure that your default compiler is the correct, otherwise the installation script will not be able to compile the MEX files:
sudo apt-get install gcc-4.9
sudo apt-get install g++-4.9
sudo apt-get install libstdc++-4.9-dev
Use the 4.9 as default gcc compiler
sudo ln -s /usr/bin/gcc-4.9 /usr/bin/gcc
sudo ln -s /usr/bin/g++-4.9 /usr/bin/g++
now check that the actual version is 4.9
gcc --version
This should not be a problem, since the kit includes several binaries, but just in case you would like to compile your owns.
Past Matlab versions used gcc-4.7 so this is also valid, just changing accordingly 4.9 by your correct version.
In Matlab command window define your correct path variables ,
% first delete the old MEX binaries generated for my particular architecture
root_path = 'your_path_to_ecgkit/';
rm([common_path '*.' mexext])
then recompile for your particular architecture.
common_path = [ root_path 'common' filesep];
source_files = dir([ common_path '*.c'] );
lsource_files = length(source_files);
for ii = 1:lsource_files
[~, source_file_name] = fileparts( source_files(ii).name);
mex_file = dir([common_path source_file_name '.' mexext ]);
eval(['mex -outdir ''' common_path ''' ''' [common_path source_files(ii).name] '''']);
end
Best,
Mariano.