openEMS/matlab/setup.m

37 lines
953 B
Matlab
Raw Normal View History

function setup()
% function setup()
%
% setup openEMS Matlab/octave interface
%
% openEMS matlab/octave interface
% -----------------------
% author: Thorsten Liebig (2011)
disp('setting up openEMS matlab/octave interface')
% cd to directory of this file and restore current path at the end
current_path = pwd;
dir = fileparts( mfilename('fullpath') );
cd(dir);
if isOctave()
disp('compiling oct files')
fflush(stdout)
if isunix
[res, fn] = unix('find /usr/lib -name libhdf5.so');
if length(fn)>0
[hdf5lib_dir, hdf5lib_fn] = fileparts(fn);
disp(["HDF5 library path found at: " hdf5lib_dir])
2016-09-26 13:33:29 +00:00
mkoctfile(["-L" hdf5lib_dir ],"-lhdf5", "h5readatt_octave.cc")
else
2016-09-26 13:33:29 +00:00
mkoctfile -lhdf5 h5readatt_octave.cc
end
else
2016-09-26 13:33:29 +00:00
mkoctfile -lhdf5 h5readatt_octave.cc
end
else
disp('Matlab does not need this function. It is Octave only.')
end
cd(current_path);