MATLAB: How to symsum to type follow eqution

symsum

for example:if i know A1=1, A2=3,A3=7,B1=2,B2=4,B3=8 and so on, i want to symsum An+Bn , which n is variable,like A1+B1+A2+B2+A3+B3+…+An+Bn . how to type it in matlab?

Best Answer

syms A B n m
total = symsum(A(m)+B(m), m, 1, n)
later you can
subs(total, n, 5) %to make n 5
Related Question