sum of products to a series and a function

Hello,
I wanted to find a series of 'h' starting from 1 to "p" for the expression:
where H(m) is a known series of p values; erfc is complementary error function, u is a known parameter. I have written the expression in Mupad successfully and could evaluate the series in Matlab by copying the expression from Mupad to matlab command window since H(m)is located in Matlab worksplace. This is tedious when the series gets longer and needs to change the value of "u".
I appreciate your help. Thank you. maharjan

Answers (2)

syms m p
k=u/sqrt(p-m+1);
q= erfc(k);
h=symsum(q,m,1,p);
f=symfun(h,p);
for i=(1:1:20)
a(i)=f(i);
b(i)=eval(a(i));
end
I got up to the above limit but still could not figure out how to multiply by "m"th term of H. I am getting sym/subsindex error. Bear in mind that as size of "p" changes numbers of "m" changes. Any help is appreciated.

Asked:

on 1 Feb 2015

Answered:

on 4 Feb 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!