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