Skip to content

Commit c0bb53c

Browse files
committed
load CSV into Table
1 parent aed025b commit c0bb53c

5 files changed

Lines changed: 411 additions & 8 deletions

Demonstrate_Bayesian_strategy_analysis.m

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
addpath Strategy_models/ % must add this path to access strategy models
1111
addpath Functions/ % must add this path to access functions that implement analysis
1212

13-
load Processed_data/PeyracheDataTables.mat % a struct PeyracheData containing 4 Tables as fields, one per rat
14-
testData = PeyracheData.Rat_2;
13+
%% Either: directly load a Table of your data: strategy model code will use the variable names in the table
14+
% load Processed_data/PeyracheDataTables.mat % a struct PeyracheData containing 4 Tables as fields, one per rat
15+
% testData = PeyracheData.Rat_2;
16+
17+
% OR: load a file into a table - here, a CSV file, whose column headers
18+
% become the variable names
19+
testData = readtable('Processed_data\Peyrache_Rat2_data.csv','TextType','string');
1520

1621
%% choose type of prior
1722
prior_type = "Uniform";

Demonstrate_Multiple_Bayesian_strategy_analysis.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
addpath Strategy_models/ % must add this path to access strategy models
1414
addpath Functions/ % must add this path to access functions that implement analysis
1515

16-
load Processed_data/PeyracheDataTables.mat % a struct PeyracheData containing 4 Tables as fields, one per rat
17-
testData = PeyracheData.Rat_2;
16+
% load data into a Table - strategy models will use variable names stored with Table to
17+
% access each column's data
18+
testData = readtable('Processed_data\Peyrache_Rat2_data.csv','TextType','string');
1819

1920
%% choose strategies to evaluate
2021
% list of function names in Strategy_models/ folder - runs all of them to

Demonstrate_interpolation_of_null_trials.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
addpath Strategy_models/ % must add this path to access strategy models
2020
addpath Functions/
2121

22-
load Processed_data/PeyracheDataTables.mat % a struct PeyracheData containing 4 Tables as fields, one per rat
23-
testData = PeyracheData.Rat_2;
22+
% load data into a Table - strategy models will use variable names stored with Table to
23+
% access each column's data
24+
testData = readtable('Processed_data\Peyrache_Rat2_data.csv','TextType','string');
25+
2426

2527
%% choose strategies to evaluate
2628
% list of function names in Strategy_models/ folder - choosing here to use

0 commit comments

Comments
 (0)