Program no Name balwan dome Roll no 14180 function st_line() clc n=input('n enter the no of data points'); for i=1:n sx=0; sy=0; and sxy=0. Enter the value of x row wise:1 and y row wise:0.
Program no Name balwan dome Roll no 14180 function st_line() clc n=input('n enter the no of data points'); for i=1:n sx=0; sy=0; and sxy=0. Enter the value of x row wise:1 and y row wise:0.
Program no Name balwan dome Roll no 14180 function st_line() clc n=input('n enter the no of data points'); for i=1:n sx=0; sy=0; and sxy=0. Enter the value of x row wise:1 and y row wise:0.
Roll no 14180 function st_line() clc n=input('\n enter the no of data points'); for i=1:n x(i)=input('\n enter the value of x row wise:'); y(i)=input('\n enter the value of y row wise:'); end sx=0; sy=0; sxy=0; sxx=0; for i=1:n sx=sx+x(i); sy=sy+y(i); sxy=sxy+x(i)*y(i); sxx=sxx+x(i)*x(i); end ds=(sx*sx-n*sxx); da=(sy*sx-n*sxy); db=(sx*sxy-sxx*sy); a=da/ds; b=db/ds; fprintf('\ny=(%f)*x=(%f)',a,b); end