function [M] = Build_Coop(CONST_NUM_NODES,NODE_TYPE,Neuron_type,mult_fact) % Building the cooperation matrix (first with only 1s on the diagonal) M = eye(CONST_NUM_NODES,CONST_NUM_NODES); % Setting the required elements of the diagonal to 0 switch Neuron_type case 'Sensory' for n = 1:279 if NODE_TYPE(n) ~= 1 && NODE_TYPE(n) ~= 4 && NODE_TYPE(n) ~= 5 M(n,n) = mult_fact; end end case 'Motor' for n = 1:279 if NODE_TYPE(n) ~= 3 && NODE_TYPE(n) ~= 6 M(n,n) = mult_fact; end end case 'Inter' for n = 1:279 if NODE_TYPE(n) ~= 2 M(n,n) = mult_fact; end end case 'Sensory-Inter' for n = 1:279 if NODE_TYPE(n) == 3 || NODE_TYPE(n) == 6 M(n,n) = mult_fact; end end case 'All' otherwise errordlg('!!!!!'); end end