How do I produce a graph of the slope of a group of data points?

1 Ansicht (letzte 30 Tage)
I am currently working with a set of historical price points, and I am looking to graph the slope of the changes over time. The data, however, is too erratic to create an effective best fit curve. I am fairly unfamiliar with Matlab. Is there a way to do this effectively?
  11 Kommentare
José-Luis
José-Luis am 12 Jun. 2014
What is the command you are using?
Mark
Mark am 12 Jun. 2014
I originally graphed by using:
[num,txt,raw]=xlsread('Metal Data.xlsx') x = num(1:57,1); y = num(1:57,2); plot(x,y)
That gave me the base plow. I then tried to input the line that you gave me:
plot(diff(x,y));
but it gave me the aforementioned error.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

José-Luis
José-Luis am 12 Jun. 2014
plot(diff(y));
Please read the documentation to see how diff() works.
Please accept an answer when your problem has been solved.
  2 Kommentare
Mark
Mark am 12 Jun. 2014
Thank you so much for your help, my boss likes your answer!
José-Luis
José-Luis am 12 Jun. 2014
Bearbeitet: José-Luis am 12 Jun. 2014
My pleasure.
Tell your boss he can give me a job if he wants to... ;)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by