z_ext = cba_set_external_prizes(network,list); construct the vector of external metabolite values cell array 'list' contains, in subsequent pairs, a number of metabolite names and the respective values
0001 function z_ext = cba_set_external_prizes(network,list); 0002 0003 % z_ext = cba_set_external_prizes(network,list); 0004 % 0005 % construct the vector of external metabolite values 0006 % cell array 'list' contains, in subsequent pairs, 0007 % a number of metabolite names and the respective values 0008 0009 names = list(1:2:end-1); 0010 values = cell2mat(list(2:2:end)); 0011 0012 ind = label_names(names,network.metabolites); 0013 z = zeros(length(network.metabolites),1); 0014 z(ind) = values; 0015 0016 z_ext = z(find(network.external)); [1 1 1 1 1 1 1 1]';