matlab iterate over two arrays