Method on @symfun: plus (f, g)
Operator on @symfun: f + g

Add two symbolic functions together.

Example:

syms x
f(x) = 2*x;
g(x) = sin(x);

h = f + g
  ⇒ h(x) = (symfun) 2⋅x + sin(x)

Matrix example:

syms x y
f(x, y) = sym([1 2; 3 4]);
g(x, y) = [x 0; 0 y];

h = f + g
  ⇒ h(x, y) = (symfun)
      ⎡x + 1     2  ⎤
      ⎢             ⎥
      ⎣  3     y + 4⎦

See also: @symfun/minus.

Package: symbolic