Method on @sym: resize (a, m)
Method on @sym: resize (a, n, m)
Method on @sym: resize (a, [n m])

Resize a symbolic array, cropping or padding with zeros.

Example

A = sym([1 2; pi 4])
  ⇒ A = (sym 2×2 matrix)
      ⎡1  2⎤
      ⎢    ⎥
      ⎣π  4⎦

resize(A, 1, 4)
  ⇒ (sym) [1  2  0  0]  (1×4 matrix)

resize(A, [1 4])
  ⇒ (sym) [1  2  0  0]  (1×4 matrix)

resize(A, 3)
  ⇒ (sym 3×3 matrix)
      ⎡1  2  0⎤
      ⎢       ⎥
      ⎢π  4  0⎥
      ⎢       ⎥
      ⎣0  0  0⎦

See also: @sym/reshape.

Package: symbolic