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

回答 (2 件)

per isakson
per isakson 2015 年 2 月 1 日
編集済み: per isakson 2015 年 2 月 1 日

1 投票

Is matlabFunction what you are looking for? &nbsp See matlabFunction, Convert symbolic expression to function handle or file
Maharjan
Maharjan 2015 年 2 月 4 日

0 投票

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.

質問済み:

2015 年 2 月 1 日

回答済み:

2015 年 2 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by