I used this and I think the dimension is matched but get some error report:

```
matrix[N,2] u = append_col(resi,resi .* X[,2]);
vector[2] M = rep_vector(0,2);
matrix[N,1] D1 = u * M;
```

Variable definition base type mismatch, variable declared as base type matrix variable definition has base type vectorVariable definition dimensions mismatch, definition specifies 2, declaration specifies 1

```
26: matrix[N,1] D1 = u * M;
^
```