MATLAB: Could anyone help me to solve the error in the following code

symsum

code:
syms n k
n=4
k=0
symsum(nchoosek(n,k),k,0,n)
If i run the code it gives error stating Undefined function 'symsum' for input arguments of type 'double'.
Could anyone help me how to overcome it.

Best Answer

>> syms n k
>> symsum(nchoosek(n,k),k,0,n)
ans =
2^n
>> subs(ans, n, 4)
Related Question