Boyenerji,
возможно вы хотели так ...
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body>
<div id="my"></div>
<script>
const matrix = [[1,2,3,4,5],[1,2,3,4,5]];
let html = matrix.map(m => `<div class="ots">${m.join('')}</div>`).join('');
document.querySelector('#my').insertAdjacentHTML('beforeend', html);
</script>
</body>
</html>