-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateRSQTable.m
More file actions
31 lines (24 loc) · 1.12 KB
/
Copy pathcreateRSQTable.m
File metadata and controls
31 lines (24 loc) · 1.12 KB
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
%============== Create rsqTable ==============
%redirecting folder to correct path. clear.
clear all; clc;
%insert local path of Tshort.csv and Tlong.csv file
Tlong = '/Users/land/Desktop/projectTrackProfiles/supportFiles/Tlong.csv';
colorProfiles = '/Users/land/Desktop/projectTrackProfiles/supportFiles/colorProfiles.csv';
%convert csv into a table.
Tlong = readtable(Tlong);
colorProfiles = readtable(colorProfiles);
%generate column of tracts of interest ids
mask = ismember(Tlong.structureID, colorProfiles{:, 1});
tractIDs = Tlong(mask, :);
tractIDs = unique(tractIDs.structureID);
rsqTable = table(tractIDs);
%============== Export rsqTable as a csv ==============
%local path to save table:
mainpath = '/Users/land/Desktop/projectTrackProfiles/supportFiles';
table_path_format_rsqTAdj = fullfile(mainpath, 'rsqTableAdj.csv');
table_path_format_rsqTOrd = fullfile(mainpath, 'rsqTableOrd.csv');
table_path_format_inflecT = fullfile(mainpath, 'inflecTable.csv');
%funally, save tables
writetable(rsqTable, table_path_format_rsqTAdj);
writetable(rsqTable, table_path_format_rsqTOrd);
writetable(rsqTable, table_path_format_inflecT);