ones
ones(m)
ones(m, n)
ones(m, n, p, ...)
ones([m])
ones([m, n])
ones([m, n, p, ...])
Create a matrix containing ones.
Try it yourself:
$1 | ones(3)
| |
$2 | ones(3, 5)
| |
$3 | ones([2,3]) * 4.5
| |
$4 | a = [1, 2, 3; 4, 5, 6]
| |
$5 | ones(size(a))
|