How to sum particular values on the y axis
2 ビュー (過去 30 日間)
古いコメントを表示
I wish to sum the y axis values for the frequencies between 300Hz to 1000Hz, how do I do this?
0 件のコメント
回答 (1 件)
Torsten
2023 年 5 月 3 日
移動済み: Torsten
2023 年 5 月 3 日
X = 0:1300;
Y = rand(size(X))
s = sum(Y(X>=300 & X<=1000))
7 件のコメント
Torsten
2023 年 5 月 3 日
編集済み: Torsten
2023 年 5 月 3 日
I wish to sum the value of each curve, I have used your code to do this. Does the code now look fine to sum over these ten curves?
Yes, if by "summing" you really mean "summing the Y-values". If you mean "integrate over the Frequency", you will have to multiply the result by "sampleFreq/burst_length". Or use "trapz".
参考
カテゴリ
Help Center および File Exchange で Fourier Analysis and Filtering についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!