MATLAB: When i try to run this code , i receive that error x1=(m+1)*(​3*delta_fn​(2m,0,25)-​delta_fn(2​m-1,0,25)) | Error: Unexpected MATLAB expression. >>why ?

summationunexpected matlab expression

function [x,n]=delta_fn(n0,n1,n2)
n=n1:n2
x=[(n-n0)==0];
syms m
n=[0:25];
x1=(m+1)*(3*delta_fn(2m,0,25)-delta_fn(2m-1,0,25))
y=symsum(x1,m,0,10);

Best Answer

2m should be 2*m