Changed extraction of filename to MATLAB function "fileparts"
This commit is contained in:
parent
1210dbb16f
commit
43184cd02f
@ -51,7 +51,11 @@ params.mwPower = bruker_params.MWPW * 1e3;
|
||||
params.QValue = "NOT RECORDED";
|
||||
params.mwAtten = str2double(extractBefore(string(bruker_params.PowerAtten),' '));
|
||||
params.mwFreqs = "NOT RECORDED";
|
||||
params.Name = string(bruker_params.TITL);
|
||||
|
||||
%get filename for further documentation and exporting figures
|
||||
[datapath,dataname,~] = fileparts(corrpath);
|
||||
params.Path = datapath;
|
||||
params.Name = dataname;
|
||||
|
||||
%echo what information is contained in the structure called 'params'
|
||||
params
|
||||
|
@ -28,12 +28,13 @@ function [Data,params] = load_matlab(path)
|
||||
% Name: "/some/path"
|
||||
|
||||
%correct \ for /
|
||||
corrpath = replace(path,"\","/")
|
||||
corrpath = replace(path,"\","/");
|
||||
|
||||
load(corrpath,'Data','params')
|
||||
|
||||
%get filename for further documentation and exporting figures
|
||||
dataname = string(extractBefore(extractAfter(path,asManyOfPattern(wildcardPattern + "/")),'.'));
|
||||
[datapath,dataname,~] = fileparts(corrpath);
|
||||
params.Path = datapath;
|
||||
params.Name = dataname;
|
||||
|
||||
%echo what information is contained in the structure called 'params'
|
||||
|
Loading…
x
Reference in New Issue
Block a user