Answered step by step
Verified Expert Solution
Question
1 Approved Answer
matlab DEBUG CODE S. (10 pts) Consider the following code, which calculates the two linear regression coefficien the problem at the bottom of the page:
matlab
DEBUG CODE S. (10 pts) Consider the following code, which calculates the two linear regression coefficien the problem at the bottom of the page: Function [al, a0]-linreg2 (x, y) n=length (x) ; sumx-0; sumx2 0 ssumy 0 7 for i=1:n sunxy sunxytX ( ) * y ( i ) ; sumx= sumx+x (i) ; sumy-sumyty (i); sunx2=sumx2 +x(1)^2; 11 12end 13a1= (nt sumxy-sumx * sumy) / (n* sumx2-sumx^2 ) ; 4 a0-sumy-al*sumx; send When the function is called in the command window, the following appears: >> linreg2 ([3 4 5], [10 8 6]) ans = This issue may have occurred for you during the semester. The code indicates in the function declaration line that there should be two outputs. Fix the problem so that both outputs are printed and saved and report what the outputs will beStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started