Correlation regression lines between two parameters
4 views (last 30 days)
Hello dear Researchers,
I have a query need your expertise to resolve.
I want to add correlation regression for two paramters for comparison purpose.
I have attached sub-plots which are scatter plots among two orientations.
Now purpose is to add correlation regression line i.e., one plot I added from a reference.
yanqi liu on 9 Nov 2021
Edited: yanqi liu on 9 Nov 2021
sir, may be upload some data, use lsqcurvefit、polyfit and so on to compute the coef
please check the follow code to get some information
for more information,you can read the book 《计算机视觉与深度学习实战》，Thank you！
clc; clear all; close all;
xdata = linspace(0,3);
ydata = 1.3*xdata + 0.05*randn(size(xdata));
lb = ;
ub = ;
fun = @(x,xdata)x(1)*xdata+x(2);
x0 = [0,0];
x = lsqcurvefit(fun,x0,xdata,ydata,lb,ub)
title('Data and Fitted Curve')
More Answers (1)
Adam Danz on 8 Nov 2021
Edited: Adam Danz on 8 Nov 2021
Common methods of adding a simple linear regression line
1. Use lsline which will add a regression line for each set of data in the plot.
Examples of #1 & #2
Example of #3