フィルターのクリア

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 Center および File ExchangeSupport Vector Machine Regression についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by