你好,函数代码供参考:
function s = fun(n) s = sym(sum(cumprod(1:n))); end
调用
fun(20) ans = 2561327494111820288
可见结果很不错,有帮助望给个采纳支持一下答题哦