Error in Build,deploy android app model using Accelerometer sensor.
조회 수: 6 (최근 30일)
이전 댓글 표시
function [peaks, peakno]= Accelerometerdata(Acceleration)
z = Acceleration.Z;
smtlb = sgolayfilt(z,9,21);
peaks=findpeaks(smtlb,t,'MinPeakDistance',1);
peakno=numel(findpeaks(smtlb));
end
댓글 수: 0
답변 (1개)
Walter Roberson
2023년 1월 31일
Is there a particular reason your last line is not
peakno = numel(peaks);
??
I would suggest that you pre-allocate peaks and that you pass the maximum size as NPeaks to findpeaks() . That will prevent Simulink from complaining about peaks being unknown size.
댓글 수: 5
Walter Roberson
2023년 2월 8일
Suppose that you did manage to return a variable-length list of peak heights. What would you do with the variable-length list downstream ?
참고 항목
카테고리
Help Center 및 File Exchange에서 Signals에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!