Best fit line to time series data

1 回表示 (過去 30 日間)
Alessandra Burgos
Alessandra Burgos 2016 年 7 月 29 日
コメント済み: Swarooph 2016 年 7 月 29 日
Hi, I have annual temperature data (so time on the x-axis, temperature on y-axis). However, I haven't been able to plot a linear best fit trend line on my data. I can get it to work if I plot my data as a scatter plot, but I solely want the plot command because I want the data shown as lines. How can I get a trend line to show up on my data, along with output expressing the slope of this line? Any help much appreciated, thank you.

回答 (1 件)

Swarooph
Swarooph 2016 年 7 月 29 日
Use the basic fitting UI. Documentation here.
  2 件のコメント
Alessandra Burgos
Alessandra Burgos 2016 年 7 月 29 日
I have multiple data lines on the same plot that I want the trend line to show up on, and the basic fitting doesn't allow? for the trend line to stay on all lines
Swarooph
Swarooph 2016 年 7 月 29 日
Do you want one trend line for each of the data lines? Or one trend line for all the data put together? Former is definitely possible. You just 'choose' the data you want the trend line for. The latter (I am not so sure about this), you might have to massage the data so all data is in a single variable to be able to use this functionality.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeFit Postprocessing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by