【发布时间】:2016-11-01 17:43:00
【问题描述】:
我正在尝试将回归线添加到 MATLAB 中的绘图上。 这是我的代码:
errorbar(x,y,SEM,'o')
hold on % Retains current plot while adding to it
scatter(x,y)
title('The Effect of Distance Between Images on the Flashed Face Distortion Effect','FontSize',14); % Adds title
xlabel('Distance (Pixels)','FontSize',12); % Adds label on the x axis
ylabel('Average Distortion Rating','FontSize',12); % Adds label on the y axis
hold off
这是我的回归代码: mdl = fitlm(x,y,'线性');
谁能告诉我如何将两者结合起来,以便我得到情节上的回归线? 我在 Windows 上的 MATLAB 上使用 psychtoolbox。 谢谢!
【问题讨论】:
-
我猜你也有曲线拟合工具箱?您可以简单地在
hold off之前添加带有右轴限制的plot(mdl),它应该可以工作。
标签: matlab regression