both working in MATLABSolutionProbelm 1 fxx12x222 x fvalfmin

both working in MATLAB

Solution

Probelm 1

f=@(x)((x(1)^2)+(x(2)-2)^2);

[x, fval]=fminsearch(f,[-2 6])

OUTPUT

x =
-0.0000 2.0000
fval =
1.3044e-09

Problem 2

(a)

data=[16 19   27   17   17   13   0;
18   22   21   15   10   13   12;
17   20   15   13   11   15   13;
13   15   20   15   15   0   0;
19   21   25   15   0   12   14;
21   20   20   14   14   14   19;
22   26   23   13   15   19   14;
0   19   23   11   9   16   12;
20   25   21   14   8   17   15;
16   19   19   15   13   8   14;
23   27   27   19   19   18   24;
26   20   20   20   19   16   25;
23   27   28   20   18   21   25;
22   28   30   19   18   21   24;
20   19   17   11   0   12   14];

(b) mean_column=mean(data);

ans =
18.4000 21.8000 22.4000 15.4000 12.4000 14.3333 15.0000

(c)mean_row=mean(data\');

ans =
Columns 1 through 9
15.5714 15.8571 14.8571 11.1429 15.1429 17.4286 18.8571 12.8571 17.1429
Columns 10 through 15
14.8571 22.4286 20.8571 23.1429 23.1429 13.2857

(d) variance_data=var(data)

ans =
37.1143 14.8857 18.2571 8.9714 38.1143 28.3810 61.0000

both working in MATLABSolutionProbelm 1 f=@(x)((x(1)^2)+(x(2)-2)^2); [x, fval]=fminsearch(f,[-2 6]) OUTPUT x = -0.0000 2.0000 fval = 1.3044e-09 Problem 2 (a) da

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site