sum of products to a series and a function

1 view (last 30 days)
Maharjan
Maharjan on 1 Feb 2015
Answered: Maharjan on 4 Feb 2015
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)

per isakson
per isakson on 1 Feb 2015
Edited: per isakson on 1 Feb 2015
Is matlabFunction what you are looking for? &nbsp See matlabFunction, Convert symbolic expression to function handle or file

Maharjan
Maharjan on 4 Feb 2015
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.

Community Treasure Hunt

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

Start Hunting!