From 922e47e18e363d068a8869356c003fc0cdcaa299 Mon Sep 17 00:00:00 2001 From: sakul-45 <81963567+sakul-45@users.noreply.github.com> Date: Wed, 30 Jun 2021 21:47:44 +0200 Subject: [PATCH] Finished basic structure of function. --- load_matlab.m | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/load_matlab.m b/load_matlab.m index ff546c2..8e03e32 100644 --- a/load_matlab.m +++ b/load_matlab.m @@ -1,7 +1,19 @@ -function [outputArg1,outputArg2] = load_matlab(inputArg1,inputArg2) -%LOAD_MATLAB Summary of this function goes here -% Detailed explanation goes here -outputArg1 = inputArg1; -outputArg2 = inputArg2; +function [Data,params] = load_matlab(path) +%LOAD_MATLAB imports EPR data recorded with MATLAB script +% Usage: ['data_as_double','struct_with_parameters'] = load_matlab('C:/full/path/to/file.mat') +% +% Imports data exported from MATLAB workspace and extracts the filename. +% Input has to be the full path to file with forwardslashes as char or +% string. The extracted name is appended to the 'params' struct, whos +% contents are displayed in the command window afterwards. + +load(path,'Data','params') + +%get filename for further documentation and exporting figures +dataname = string(extractBefore(extractAfter(path,asManyOfPattern(wildcardPattern + "/")),'.')); +params.Name = dataname; + +%echo what information is contained in the structure called 'params' +params end