From 16a0b198f653d4a948546869430efd19315a83f4 Mon Sep 17 00:00:00 2001 From: sakul-45 <81963567+sakul-45@users.noreply.github.com> Date: Wed, 21 Apr 2021 21:59:45 +0200 Subject: [PATCH] added first input requests --- EPR_script.m | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/EPR_script.m b/EPR_script.m index 582b783..b1750af 100644 --- a/EPR_script.m +++ b/EPR_script.m @@ -1,28 +1,27 @@ % high-spin S=1 simulation -% Go through the script line by line. Every "return" stops it. -% When you have completed the task, comment out that "return" -% so the script runs to the next "return" -% An important part of your task is to understand the script. -% I will be asking you about this in the exam. -% This will be easier for those of you who attended the simulation session. +% Inputs requested in command line at certain points -clear all +clear variables close all %% Baseline Correcting -load '..\..\Messdaten\TR_EPR\EMX_Aufbau\HU_F2\HU_F2_435nm.mat' % check this matches the name of your data file +% loading Data +path = input('Path to dataset: ','s'); +load(path) whos % what variables have been loaded params % what information is contained in the structure called 'params' - % plot the raw data & check the number of points before the signal (pre-trigger) -% plot(Data) -% return +% plot the raw data & check the number of points before the signal (pre-trigger) +plot(Data) +title('raw data') - % substract the pre-trigger. Check how many points from the plot above -signal_baseline_field = bsxfun(@minus, Data, mean(Data(1:1100,:))); -% plot(signal_baseline_field) % plot the corrected data set -% return +% substract the pre-trigger +pre_trigger = input('Number of pre-trigger points: '); +signal_baseline_field = bsxfun(@minus, Data, mean(Data(1:pre_trigger,:))); +plot(signal_baseline_field) % plot the corrected data set +title('corrected data') +return % plot the transpose and check the number of points to the lower and higher fields of the signal % plot(signal_baseline_field')