Error! Cannot compute the sum with respect to '0.75'. The summation index must be a symbolic variable

4 views (last 30 days)
Expression 1-(8/pi^2)*symsum((1/(2*n+1)^2).*exp(-(D*(2*n+1)^2*pi^2.*x)/(2*h)^2),n,0,inf) is not a valid MATLAB expression, has non-scalar coefficients, or cannot be evaluated:
Error in fittype expression ==> 1-(8./pi.^2).*symsum((1./(2.*n+1).^2).*exp(-(D.*(2.*n+1).^2.*pi.^2.*x)./(2.*h).^2),n,0,inf)
??? Cannot compute the sum with respect to '0.75'. The summation index must be a symbolic variable.
When use the cftool toolbox,and the n is defined as syms n
  5 Comments
Yp Wu
Yp Wu on 17 May 2022
Thank you very much for your reply, I understand what you mean, and tried in this way, another error is the symsum formula has too many variables.
Torsten
Torsten on 17 May 2022
If you work with a numerical fitting tool like cftool, you should also work with the numerical "sum" instead of the symbolic "symsum".

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!