# How to find the slope of phase data (between two points) which is uneven

15 views (last 30 days)

Show older comments

Sriram Guddati
on 12 Oct 2018

Answered: Greg Dionne
on 26 Oct 2018

##### 0 Comments

### Accepted Answer

Image Analyst
on 12 Oct 2018

You ask ONLY about the slope, not about finding a and b, so I assume you've found "a" and "b" already. So, assuming your "a" is index1 and "b" is index2, you can do this

coefficients = polyfit(x(index1):x(index2), signal(index1:index2), 1);

slope = coefficients(1);

### More Answers (2)

jonas
on 12 Oct 2018

Edited: jonas
on 12 Oct 2018

### See Also

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!