Hi, everyone!
古いコメントを表示
I need assistance, actually I have a matrix b=2500x21, which is imaginary part of a FRF signal. I want to find peaks for every column, each column represents accelerometer response at different location of a beam. The following code i have written.
for i=1:21
pks(:,i)=findpeaks(b(:,i))
end
pks(:,i)=pks;
Problem is that, the matrix pks just stores last iteration value. I want that all the peak values after every iteration will be stored in a single matrix.
Can any body having suggestions?
8 件のコメント
madhan ravi
2018 年 8 月 31 日
編集済み: madhan ravi
2018 年 8 月 31 日
Just format the code using the code button. So that it’s easy for others to read your code.
Walter Roberson
2018 年 8 月 31 日
After your for loop, i will be left at its last value, 21. Then your final statement there would be equivalent to
pks(:,21) = pks;
which tries to store the entire pks array into a single location in the pks array. I am having difficulty coming up with any circumstance under which that could work without giving an error message.
I suspect that the for loop will generate an error, as most of the time the different columns of signal will lead to a different number of peaks being found, leading to errors when you tried to store the different vector lengths into the same array.
Stephen23
2018 年 8 月 31 日
What is the purpose of this?:
pks(:,i)=pks;
Ayisha Nayyar
2018 年 8 月 31 日
Ayisha Nayyar
2018 年 8 月 31 日
Stephen23
2018 年 8 月 31 日
Hi jonas, I have attached the file, now follow the code and see the results please.
for i=1:21
pks(:,i)=findpeaks(b(:,i))
end
pks(:,i)=pks;
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Signal Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!