Home > metabolic-economics > metabolic-economics-utils > cba_set_external_prizes.m

cba_set_external_prizes

PURPOSE ^

z_ext = cba_set_external_prizes(network,list);

SYNOPSIS ^

function z_ext = cba_set_external_prizes(network,list);

DESCRIPTION ^

 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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

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]';

Generated on Fri 12-Feb-2016 20:18:22 by m2html © 2003