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)

Réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 17 Nov 2013
Modifié(e) : Azzi Abdelmalek le 17 Nov 2013

0 votes

diff(v)./diff(t)

2 commentaires

Masilani
Masilani le 21 Nov 2013
Modifié(e) : Masilani le 21 Nov 2013
i want to obtain the slope by separating it 2 sections.Instead of obtaining 4 answers,just limit them to 2
Image Analyst
Image Analyst le 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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Line Plots dans Centre d'aide et File Exchange

Tags

Question posée :

le 17 Nov 2013

Commenté :

le 21 Nov 2013

Community Treasure Hunt

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

Start Hunting!

Translated by