MATLAB: Program sum in matlab

programmingsum

Any help for write this program will be great. Thank
you

Best Answer

Here is a starting point for you. Use symsum function from Symbolic Toolbox. See the example:
m=5;
P=sym('P',[1 m]);
t=sym('t',[1 m]);
q=sym('q',[1 m]);
syms k h
fun=sum(symsum((P+(t.*q/2).*h)./(t),k,1,m))
The rest is yours to do.