Plot linear regression without data points

10 ビュー (過去 30 日間)
Pauli
Pauli 2019 年 4 月 1 日
コメント済み: Pauli 2019 年 4 月 1 日
Hello,
I have a figure with a scatter plot and I want to add a linear regression with different data. I only want to plot the regression line and not the data.
I use
mdl = fitlm(x,y);
plot(mdl)
Is there a way to exlude the data points of x and y in my plot?
Thanks a lot in advance!

採用された回答

KSSV
KSSV 2019 年 4 月 1 日
x = rand(20,1) ;
y = rand(20,1) ;
mdl = fitlm(x,y);
h = plot(mdl) ;
delete(h(1))
  1 件のコメント
Pauli
Pauli 2019 年 4 月 1 日
Great, thank you!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by