Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to convert a scalar value into a large matrix

    Say I have a value of 2

    How can I convert this into say a [50,1] matrix such that it is the same size to do some addition/subtraction with my other matrix

    Currently I only know using mat X = (2\2\2\2), but I don't want to have to forward slash 50 times, is there a faster way?

  • #2
    Code:
    matrix X = J(50, 1, 2)

    Comment

    Working...
    X