Added correcting \ for / in input paths

This commit is contained in:
sakul-45 2021-07-04 21:10:07 +02:00
parent 3c66006505
commit 9d56441c79
2 changed files with 8 additions and 2 deletions

View File

@ -11,8 +11,11 @@ function [Data,params] = load_bruker(path)
%
% Note that this funtion is dependent on easyspin.
%correct \ for /
corrpath = replace(path,"\","/");
%load Bruker data with help of easyspin
[bruker_axes,Data,bruker_params] = eprload(path);
[bruker_axes,Data,bruker_params] = eprload(corrpath);
%assign metadata to custom params struct
params.Field_Center = bruker_params.YMIN + 0.5*bruker_params.YWID;

View File

@ -7,7 +7,10 @@ function [Data,params] = load_matlab(path)
% string. The extracted name is appended to the 'params' struct, whos
% contents are displayed in the command window afterwards.
load(path,'Data','params')
%correct \ for /
corrpath = replace(path,"\","/")
load(corrpath,'Data','params')
%get filename for further documentation and exporting figures
dataname = string(extractBefore(extractAfter(path,asManyOfPattern(wildcardPattern + "/")),'.'));