Engineering Homework Help
Engineering Homework Help. Fixing my code Matlab asap
%PROBLEM 7
a=xlsread(‘HW3data (1).xlsx’)
x1 =a(:,4);
x2 =a(:,5)
x3 =a(:,6)
Y =a(:,7);
X=[x1 x2 x3];
mdl2=fitlm(X,y)
b= mdl2.Coefficients.Estimate;
ypred = b(1)+b(2)*x1+b(3)*x2+b(4)*x3;
scatter(x1,x2,x3,’o’,’bl’);
hold on
scatter(x3,x1,x2,’o’,’bl’)
hold on
scatter(x2,x3,x1,’o’,’bl’)
hold on
plot(y,ypred,[65 95],[65,95], ‘r’,”LineWidth”,2);
hold off
legend(“Prediction”,”45 degrees reference”,”Location”,”best”)
ylabel(‘Prediction’)
xlabel(‘Data’)