As the codes shown below, I would like to build f4 based on f1 and f2, but an error occurred.
syms x y f1(x)=x+1;f2(y)=y+2;f3(x,y)=f1+y;% <-- nothing wrong
f4(x,y)=f1+f2% <-- where the error comes from
The error information:
Error using symfun/privResolveArgs (line 218)
Symbolic function input arguments must match.
Error in sym/privBinaryOp (line 1001)
args = privResolveArgs(A, B);
Error in + (line 7)
X = privBinaryOp(A, B, 'symobj::zipWithImplicitExpansion', '_plus');
Error in test_July_2020 (line 28)
f4(x,y)=f1+f2
Can someone please tell me why f3 can be built but f4? How to build a symfun based on other symfuns?
Best Answer