Finding Local Maxima and Local Minima using fundamental signals | DSP | MATLAB
clc
clear all
close all
t=0:0.01:10*pi;
x=2*sin(t)+0.5*t;
plot(t,x,'r','linewidth',5);
hold on;
gs=diff(x);
ms=sign(gs);
d=diff(ms);
e=find(d<0);
plot(t(e),x(e),'bo','linewidth',5);
hold on;
e=find(d>0);
plot(t(e),x(e),'go','linewidth',5);
legend('Original
Input Signal','Local Maxima','Local Minima');
Live Support: https://www.t.me/matlabcastor
Share with us: https://www.quora.com/q/matlabirawen
Free Codes: https://www.youtube.com/castorclasses
Free Support: https://www.castorclasses2014@gmail.com
Like us: https://www.facebook.com/matlabirawen/
Join us: https://www.facebook.com/groups/MATLA...
MATLAB Book for the beginner: https://amzn.to/3fTfmTa
Free program: https://www.matlabcoding.com
No comments