You may try
    
    
    type
      Matrix*[W, H: static int] = array[W, array[H, float]]
    
    func submatrix*[W, H](m: Matrix[W, H]): Matrix[W - 1, H - 1] =
      for row in 0 ..< high(m):
        for col in 0 ..< high(m[0]):
          result[row][col] = m[row][col]
    
    var
      m: Matrix[3, 3]
    
    let s = submatrix(m)
    echo s.len
    echo s[0].len
    
    
    Run

Reply via email to