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!