%% This function parses a cell array of connection indices of the form % 'i-j' into the two integers i and j % % Inputs: % % - CV is the connection cell array (each cell has the form 'i-j') % % Outputs: % % - C1 and C2 are two n_conn long vectors containing, for each, the index % of one of the regions present in the (i,j) regional pair function [C1,C2] = ParseConVec(CV) for i = 1:length(CV) [tmp3,tmp4] = strtok(CV{i},'-'); C1(i) = str2num(tmp3); C2(i) = str2num(tmp4(2:end)); end end