1 | initial version |
You can use ones_matrix
, which returns a matrix with all entries equal to 1. So, to build, say, an $1000\times1000$ matrix with all entries being $-1$, you can simply write -ones_matrix(1000,1000)
.
2 | No.2 Revision |
You As another alternative, you can use ones_matrix
, which returns a matrix with all entries equal to 1. So, to build, say, an $1000\times1000$ matrix with all entries being $-1$, you can simply write -ones_matrix(1000,1000)
.