add matrices and hosts to matrices using mesh configuration json