필터 지우기
필터 지우기

How to have linear regression data appear on figure as text?

조회 수: 1 (최근 30일)
DrWooo
DrWooo 2017년 10월 30일
편집: DrWooo 2017년 10월 30일
Hello,
I'd like to have some linear regression data appear on a figure.
Currently, the code appear as:
for x = B(1:19,5)
for y = B(1:19,12);
figure(1);
subplot(3,1,1);
scatter(x,y); grid on;
hold on
lsline
mdl = fitlm(x,y);
str1 = 'r^2 = 0.800'; %This is found by looking at the output in the command window and manually entering the value back in
text(20,250,str1); %Manually entered text location, but would be happy with it appearing elsewhere
end
end
I would like both the r^2 value and the equation of the line to appear on the figure.
Any guidance or suggestions are greatly appreciated.
Cheers

답변 (0개)

카테고리

Help CenterFile Exchange에서 Support Vector Machine Regression에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by