Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

MATLAB assignment. I have no idea where to start. Please help. When a customer v

ID: 3766960 • Letter: M

Question

MATLAB assignment. I have no idea where to start. Please help.

When a customer visits a shopping mall, a fashion expert system (FES) takes a picture of the customer and obtains his/her weight, height and BMI automatically. Then the face width is extracted from the picture using image-processing techniques; however, the shoulder length is harder to extract with the same technique. Since the shoulder length for a customer is somehow correlated with his/her weight, height, BMI and face width, it can be predicted or estimated through the given data. After the shoulder length is obtained, FES will use the data to recommend to a customer the best suitable clothing options. A file "customerdata.xlsx" is created to predict the shoulder width. It stores these data for a group of customers of the shopping mall. For example, it may look like this: WighthI Width, sengthipke) (KG) (m) x3 Face Shoulder Length(pixe Picture No. (pixels) 43.8 1.6 17.1 128 52.6 1.62 20 145 40.6 1.52 17.6 129 57 1.61 22 152 52.8 1.62 20.1 140 48.1 1.57 19.5 132 46.2 1.62 17.6 142 49.5 1.6 19.3 129 50 1.65 18.4 128 52.9 1.65 19.4 143 272 295 269 304 308 264 294 289 281 285 4 10 Where the shoulder length y is obtained manually (i.e. actual measurement from the picture). It is easy to find that xi, x2 and y are linearly correlated. Therefore, the linear regression model is recommended

Explanation / Answer

Q1. Function named "train.m"

function f=train.m

data = xlsread('two_column_file.xlsx');
x1_col = data(:,1);
x2_col = data(:,2);
y_col = data(:,5);
len= length(x1);

for i=1 to len
{
b1=(sum(x1[i]*y[i])*sum(x2[i] ^ 2))-(sum(x2[i]*y[i])sum(x1[i]*x2[i])) / sum(x1[i] ^2)*(sum(x2[i] ^2)) - sum((x1[i]*x2[i])^2)
b2=(sum(x2[i]*y[i])*sum(x1[i] ^ 2))-(sum(x1[i]*y[i])sum(x1[i]*x2[i])) / sum(x2[i] ^2)*(sum(x1[i] ^2)) - sum((x1[i]*x2[i])^2)

a=y_mean -(b1*x1_mean)-(b2*x2_mean)

disp(a)
disp(b1)
disp(b2)
}