I added a few things, but note that the [19,1] are nested vectors (19 columns, 1 row), and not a number. So if you expect a number, you have an error above. Also recommend that you use i=1..rows(matrix)-1 rather than specifying a number, more general.

Jaydeep,Each element of the SSall matrix is not a number, it is a vector of values. The following is the 0,0 element:

Do all of these values apply? If you only need the maximum, you can add max to the program. Otherwise, I don't know what you need. (all the values are positive, if negative values are possible, then you need to revise accordingly.)