While calculating power spectral density it is showing an error , vector lengths must be same
1 回表示 (過去 30 日間)
古いコメントを表示
I am calculating power spectral density of voltage and time values from an excel sheet of 2 columns and 9689 rows. while plotting the graph it is throwing an error "Error using plot Vectors must be the same length. Error in lpf (line 19) plot(fc,Nc)" Please help me out. I am attaching the code file in the above attachment.
0 件のコメント
採用された回答
Star Strider
2017 年 11 月 25 日
I cannot run your code, however I believe I see the problem.
First, delete this line:
Nc(2:end-1) = 2*Nc(2:end-1);
and change the plot calls to:
plot(fc,Nc(1:length(fc))*2)
and:
plot(fc,10*log10(Nc(1:length(fc))*2));
That should work.
12 件のコメント
Star Strider
2017 年 11 月 25 日
As always, my pleasure!
No, you don’t. You simply need time with it. None of us entered this workd knowing how to program.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Multirate Signal Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!