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))

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear and Nonlinear Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by