Info

此问题已关闭。 请重新打开它进行编辑或回答。

index exceeded matrix dimensions please help

1 次查看(过去 30 天)
I get this error what should i do to correct this?
Index exceeds matrix dimensions.
Error in t31 (line 11)
F1=Fmag((N/2)+1:N);
my code
N=length(t);
Fshifted=fftshift(F);
Fmag=norm(Fshifted);
F1=Fmag((N/2)+1:N);
F2=Fmag(N/2:-1:1);
  2 个评论
per isakson
per isakson 2019-4-16
((N/2)+1:N) is greater than 1
Fmag is a scalar
Thus the error
Walter Roberson
Walter Roberson 2019-4-16
Do not use norm() to find the magnitude of the spectrum. Use abs() .

回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by