フィルターのクリア

How to plot Multiple trend-lines on one scatter plot

19 ビュー (過去 30 日間)
Nicky T
Nicky T 2020 年 9 月 13 日
コメント済み: Nicky T 2020 年 9 月 14 日
Hi every one,
I have a scatter plot and I need to do a second order trend line for some part of my data (just for the values less than 15 or 10 on x axis). Do you know how can I do that?

回答 (1 件)

KSSV
KSSV 2020 年 9 月 13 日
編集済み: KSSV 2020 年 9 月 14 日
You can pick those respective points and fit a curve to plot the trend. Let x,y be your points.
x1 = x(x<=15) ; % pick points less than 15
y1 = y(x<=15) ;
p1 = polyfit(x1,y1,1) ; % Fit a line
figure
hold on
plot(x,y,'.k')
plot(x1,polyval(p1,x1),'r')
  11 件のコメント
KSSV
KSSV 2020 年 9 月 14 日
What are values of tRet, tSupp ??
Nicky T
Nicky T 2020 年 9 月 14 日
those are temperature. I have an excel file with lots of data.

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

カテゴリ

Help Center および File ExchangeDiscrete Data Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by