How do I populate an array with matrix elements from a file in Scala? I know that
for (val line<- Source.fromFile("mask.txt").getLines){
}
will fetch the elements row by row but how do I split each row into individual elements and store them as elements of an array?