Linear Regression - how to incorporate in figure
    2 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
Hello,
I have the following data:
x=[1 2 5 9 4 10 11 2 6]
y=[5 3 6 8 5 12 14 4 8]
I need to obtain a figure with:
- plot x y
- linear regression - y=mx+b
- Legend with linear regression equation y=mx+b
- R square value
I've seen this question: https://www.mathworks.com/matlabcentral/answers/38194-linear-regression
But still have not managed to achieve points 3 and 4.
thanks
0 comentarios
Respuestas (1)
  KSSV
      
      
 el 16 de Jul. de 2019
        Read about plotregression
x=[1 2 5 9 4 10 11 2 6] ;
y=[5 3 6 8 5 12 14 4 8] ;
plotregression(x,y);
2 comentarios
Ver también
Categorías
				Más información sobre Linear Regression en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


