How can I select multiple data points on a curve for calculating slope of each points?
3 views (last 30 days)
Show older comments
Dear all,
I have sensor data shared as schmatically below. I want to calculate slope of each determined points for feature extraction. The problem will be getting complicated later on but now I think it should be enough to know how to select points and calculate slope of that with some commands (not using 'ginput') .
Does anyone have any idea?
Thanks,

0 Comments
Answers (1)
KSSV
on 17 Jun 2020
The points which you have shown are peak points. To get the peak points you can use findpeaks. This will give you indices and values. From the indices, you can get the next point by either incresing the index by some constant value, you add this to index and get the next value. Once you know two points, you can fit a line using polyfit. This will give you slope and y-intercept.
3 Comments
See Also
Categories
Find more on Spectral Estimation in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!