# How to find a slope of signal if we do not know the value of x1, x2, y1, y2

2 views (last 30 days)

Show older comments

How can we find the slope of a signal if we do not know the value of x1, x2, y1, y2

which we cannot use

Slope = (y2 - y1) / (x2 - x1);

Example:

load sunspot.dat

year = sunspot(:,1);

avSpots = sunspot(:,2);

[pks,loc]=findpeaks(avSpots,year, 'Annotate','extents','WidthReference','halfheight')

axis([1700 1711 0 100])

give a graph of

Thank you

##### 0 Comments

### Accepted Answer

Star Strider
on 13 Feb 2019

##### 6 Comments

### More Answers (0)

### See Also

### Categories

### Community Treasure Hunt

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

Start Hunting!