how to repeat cycles in a DFT equation
3 次查看(过去 30 天)
显示 更早的评论
Hello, I have to write a code for a DFT equation. I have the code for 1 cycle below and it comes out fine. Now I have to repeat the cycle 100 times with the same x(n). I am trying to repeat with a for loop but can't get the summation right.
n=0:1:1/f; %sequence of time samples
X=cos(2*pi*f*n); %first part of equation
Xz= [(X) zeros(1,10)]; %padding zeros
Xs=0;
so I end up saying I want to repeat Xz 100 cycles
for t=0:100 Xs(t+1)=Xs(t+1)+Xz end
but matlab says the sides are not equal? Any help would be great.
0 个评论
回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!