How to draw mean value as shown in picture
조회 수: 3 (최근 30일)
이전 댓글 표시
Muhammadhn Muhammadh Khalid
2021년 11월 19일
댓글: Muhammadhn Muhammadh Khalid
2021년 11월 21일
Hi,
I want to plot the mean value as shown in red line in the attached picture.
Any help or idea is highly appreciated.
Thanks

댓글 수: 0
채택된 답변
Image Analyst
2021년 11월 19일
Another option is sgolayfilt(). It's like movmean() but instead of fitting a line to the moving window you can fit a quadratic. That should help it follow the big peak better an not smooth it out so much. I'd use a frame (window) length that's large and an order of 2 or 3. Experiment around to get what you like.
plot(x, y, 'k-');
smoothY = sgolayfilt(y, 11, 2);
hold on;
plot(x, smoothY, 'r-', 'LineWidth', 3);
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fit Postprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!