-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReadinCO2_ExperienceDepth.m
35 lines (25 loc) · 2.01 KB
/
ReadinCO2_ExperienceDepth.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
%% Import data from Breathwork CO2 Experience spreadsheet
%
% Auto-generated by MATLAB on 11-Nov-2024 12:33:09
%% Set source location
sourcefolder = ["/Users/marthanarinemrihavenith/Desktop/Manuscripts/Submitted/2023-10 Breathwork CO2/Source Excels/Breathwork_CO2_Experiencedepth.xlsx"];
%% Setup the Import Options
opts = spreadsheetImportOptions("NumVariables", 15);
% Specify sheet and range
opts.Sheet = "Sheet1";
opts.DataRange = "A2:O62";
% Specify column names and types
opts.VariableNames = ["ID", "holcon", "breath", "Depth_Time1", "CO2_Time1", "Depth_Time2", "CO2_Time2", "Depth_Time3", "CO2_Time3", "Depth_Time4", "CO2_Time4", "Depth_Time5", "CO2_Time5", "Depth_Time6", "CO2_Time6"];
opts.SelectedVariableNames = ["ID", "holcon", "breath", "Depth_Time1", "CO2_Time1", "Depth_Time2", "CO2_Time2", "Depth_Time3", "CO2_Time3", "Depth_Time4", "CO2_Time4", "Depth_Time5", "CO2_Time5", "Depth_Time6", "CO2_Time6"];
opts.VariableTypes = ["string", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double", "double"];
opts = setvaropts(opts, 1, "WhitespaceRule", "preserve");
opts = setvaropts(opts, 1, "EmptyFieldRule", "auto");
% Import the data
BreathworkCO2Experiencedepth = readtable(sourcefolder, opts, "UseExcel", false);
SubjectIDs = BreathworkCO2Experiencedepth.ID;
breathvector = BreathworkCO2Experiencedepth.breath+1;
holconvector = BreathworkCO2Experiencedepth.holcon;
co2times = [BreathworkCO2Experiencedepth.CO2_Time1,BreathworkCO2Experiencedepth.CO2_Time2,BreathworkCO2Experiencedepth.CO2_Time3,BreathworkCO2Experiencedepth.CO2_Time4,BreathworkCO2Experiencedepth.CO2_Time5,BreathworkCO2Experiencedepth.CO2_Time6];
depthtimes = [BreathworkCO2Experiencedepth.Depth_Time1,BreathworkCO2Experiencedepth.Depth_Time2,BreathworkCO2Experiencedepth.Depth_Time3,BreathworkCO2Experiencedepth.Depth_Time4,BreathworkCO2Experiencedepth.Depth_Time5,BreathworkCO2Experiencedepth.Depth_Time6];
%% Clear temporary variables
clear opts BreathworkCO2Experiencedepth sourcefolder ans