Skip to content

Commit ba7b0e8

Browse files
committed
added how to create empty vectors and matrices
1 parent 700195a commit ba7b0e8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/reference-manual/expressions.qmd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,19 @@ The empty expression `[ ]` is ambiguous and therefore is not
301301
allowed and similarly expressions such as `[ [ ] ]` or
302302
`[ [ ], [ ] ]` are not allowed.
303303

304+
#### Empty vectors and matrices {-}
305+
306+
If needed, it is possible to create an empty vector with
307+
```stan
308+
rep_vector(e, 0)
309+
```
310+
where the first expression `e` needs to scalar of type `real`.
311+
312+
If needed, it is possible to create an empty matrix with
313+
```stan
314+
rep_matrix(e, 0, 0)
315+
```
316+
where the first expression `e` needs to scalar of type `real`.
304317

305318
### Array expressions {-}
306319

0 commit comments

Comments
 (0)