How to draw mean value as shown in picture
2 次查看(过去 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 中查找有关 Curve Fitting Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!