MATLAB: Using Two Expressions together in factor()

algebraexpressionsfactorfactorization

Could anyon ehelp em with this as I am getting the below mentioned error while using two expressions together in the factor() function. Thanks
syms x y
factor([x^2-y^2,x^3+y^3])
Error using sym/factor (line 51)
First argument must be scalar.

Best Answer

syms x y
f = arrayfun(@factor, [x^2-y^2,x^3+y^3], 'uniform', 0);
vertcat(f{:})
ans =