function getSpeciesNames(m, name)
% function getspeciesNames(m, speciesString)
% 
%  Finds all species with part of their name matching speciesString,
%  and returns their index, name and value.
% 
% Inputs: m is a model
%         speciesString is the part of the species name to look for.
% 
% Outputs: none; getspeciesNames prints a list.
% 
% See also:
%     getParameterNames

% This work is licensed under the Creative Commons Attribution-Noncommercial-No Derivative 
% Works 3.0 United States License. To view a copy of this license, visit 
% http://creativecommons.org/licenses/by-nc-nd/3.0/us/ or send a letter to Creative Commons,
% 171 Second Street, Suite 300, San Francisco, California, 94105, USA.

indCell = strfind(m.xNames, name);
for i = 1:length(indCell)
    ind(i) = ~isempty(indCell{i});
end
ind = find(ind);
nameList  = m.xNames(ind);
speciesList = m.ic(ind)';

disp(sprintf('Ind   \tName    \tInitial Condition'));
for i = 1:length(ind)
    disp(sprintf('%d   \t%s   \t%f', ind(i), nameList{i}, speciesList(i)));
end