function r=get_members (s, key)

m_elements = fieldnames(s);
selected = strfind(m_elements, key);

n_elements = size(m_elements,1);
for i=1:n_elements
    if ~isempty (selected{i})
        eval (['r.' m_elements{i} ' = s.' m_elements{i} ';']);
    end
end

end