Finding gradient of a part of a graph
Show older comments

May I know how to find the gradient of the first linear part? What function should I use?
Accepted Answer
More Answers (1)
A=your signal; dx=epsilon(2)-epsilon(1); % assuming the sampling frequency is constant
[M,I] = max(A);
B=diff(A(1:I))./dx;
Categories
Find more on Sparse Matrices 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!