how Slope of a line?
Show older comments
I have plotted data and i want to obtain the gradient of the different sections of the line plot.How do i obtain the slope for the similar sections for
t=[ 1 2 3 4 5 6];
v=[10 25 30 40 45 50];
plot(t,v)
Answers (1)
Azzi Abdelmalek
on 17 Nov 2013
Edited: Azzi Abdelmalek
on 17 Nov 2013
diff(v)./diff(t)
2 Comments
Image Analyst
on 21 Nov 2013
What sections do you want? You can extract sections like this:
section1 = v(index1:index2);
where you, of course, specify the starting and ending indices of the section you want to extract.
Categories
Find more on Line Plots 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!