Comparison of persistent homologies for vector functions: from continuous to discrete and back