Skip to content

Instantly share code, notes, and snippets.

@ravnoor
Last active November 18, 2015 18:43
Show Gist options
  • Save ravnoor/f4419f2cbe026b32bbf5 to your computer and use it in GitHub Desktop.
Save ravnoor/f4419f2cbe026b32bbf5 to your computer and use it in GitHub Desktop.
Read controls (NLES-matched) demographic data in Matlab
fid = fopen('DemographicNGrouping_for_controls_Data_CT.csv');
C = textscan(fid, '%s%s%d%s%s', 'Delimiter', ',', 'CollectOutput', 1);
ID = C{1}(:, 1);
path = C{1}(:, 2);
age = int32(C{2});
sex = C{3}(:,1); sex(strcmp(sex, 'male')) = {'F'}; sex(strcmp(sex, 'female')) = {'M'};
group = C{3}(:, 2);
subject_ID_cont = ID;
subject_path_cont = path;
Age_cont = age;
Sex_cont = sex;
fclose(fid);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment