首页 > 解决方案 > 如何在MATLAB中获得简化形式的求和?

问题描述

我有这个代码来计算信号的能量。

syms n N
x3(n) = cos(pi/4*n);
x3(n) = abs(x3(n)) * abs(x3(n));
energy = symsum(x3(n),-inf,inf);
vpa(energy)

我得到这个输出。

symsum(abs(exp(-(pi*n*1i)/4)/2 + exp((pi*n*1i)/4)/2)^2, n, 0, Inf) + symsum(abs(exp(-(pi*n*1i)/4)/2 + exp((pi*n*1i)/4)/2)^2, n, 1, Inf)

如何获得实数形式的简化输出?

我还尝试通过使用 sum 而不是 symsum 进行求和来解决它,但无法获得所需的答案。

标签: matlab

解决方案


推荐阅读