find change points, point of inflection and concave up and concave down
Show older comments
This is my code and I want to find the change points of my sign curve, that is all and I want to put points on the graph where it is concave up and concave down. (2 different shapes for concave up and down would be preferred. I just have a simple sine curve with 3 periods and here is the code below. I have found the first and second derivatives. I'm not sure where to go from here. I know have to set it equal to zero and solve for x, any algorithmic help would be appreciated
x = 1:500;
X = x;
T = 1;
Fs = 499;
N = T*Fs;
t = 0: 1/Fs : T;
Fn = 3; % this control the number of cycles/periods
deltax = 0.0020;
y_sine_25HZ = sin(Fn*2*pi*t);
y = y_sine_25HZ ;
drvY = diff(y)/deltax; % one unit shorter than y
drvY = [drvY , drvY(end)]; % making up for the missing point
secondDrvY = diff(drvY)/deltax;
Accepted Answer
More Answers (2)
Osita Onyejekwe
on 31 Oct 2016
0 votes
1 Comment
dpb
on 31 Oct 2016
I'll leave that one as "exercise for the student", I think... :)
Look up the sign function and think about what happens when apply it to differences of a function changing slope.
Osita Onyejekwe
on 31 Oct 2016
0 votes
1 Comment
dpb
on 31 Oct 2016
Just so the maxima/minima will show up on the plot w/o being obscured by the outer box of the axes...
Categories
Find more on Descriptive Statistics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!