Periodogram loop for multiple columns

3 ビュー (過去 30 日間)
Rivers Cuomo
Rivers Cuomo 2022 年 9 月 1 日
回答済み: Mathieu NOE 2022 年 9 月 2 日
I have a matrix with 240 columns and I need to create a periodogram for each. How do I go from creating a peridogram for one column, to creating a loop to process all 240?
[amp, freq]=periodogram(detrend(seis(:,1)),[],[],Fs);

採用された回答

Mathieu NOE
Mathieu NOE 2022 年 9 月 2 日
hello
we should have freq the same for all 240 columns so we are not obliged to store 240 versions of the same vector
on the other side we can store the result amp in an 2D array - using the for loop :
for ci = 1:240
[amp(:,ci), freq]=periodogram(detrend(seis(:,ci)),[],[],Fs);
end
plot(freq,amp);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by