Sei sulla pagina 1di 16

>> x1=[1.73225458 1.65121938 1.62989386 1.62727783 1.64416141 1.64993992 1.

6664481
1.92181255 2.24424948 2.91307502 3.319264 3.4567319 3.504155 3.47743801 3.39663141
3.23054084 2.88256358 2.70827238 2.47681844 2.24566198 2.13258733 2.03731662 1.92570744
1.82454929]'

x1 =

1.7323

1.6512

1.6299

1.6273

1.6442

1.6499

1.6664

1.9218

2.2442

2.9131

3.3193

3.4567

3.5042

3.4774

3.3966

3.2305

2.8826

2.7083

2.4768

2.2457

2.1326

2.0373

1.9257
1.8245

>> x2=[4.04427858 4.08373291 4.11853298 4.14724267 4.17139819 4.18883118 4.20627346


4.22636162 4.21489414 4.10661344 3.76496048 3.51041047 3.30232198 3.22176497 3.09025428
3.1455163 3.31321583 3.52816281 3.64036301 3.73435361 3.82356331 3.8954057 3.95303698
4.00393347]'

x2 =

4.0443

4.0837

4.1185

4.1472

4.1714

4.1888

4.2063

4.2264

4.2149

4.1066

3.7650

3.5104

3.3023

3.2218

3.0903

3.1455

3.3132

3.5282

3.6404

3.7344

3.8236
3.8954

3.9530

4.0039

>> x3=[3.17805383 0 0.69314718 1.09861229 1.38629436 1.60943791 1.79175947 1.94591015


2.07944254 2.19722458 2.30258509 2.39789527 2.48490665 2.56494936 2.63905733 2.7080502
2.77258872 2.83321334 2.89037176 2.94443898 2.99573227 3.04452244 3.09104245
3.13549422]'

x3 =

3.1781

0.6931

1.0986

1.3863

1.6094

1.7918

1.9459

2.0794

2.1972

2.3026

2.3979

2.4849

2.5649

2.6391

2.7081

2.7726

2.8332

2.8904
2.9444

2.9957

3.0445

3.0910

3.1355

>> x4=[2.77133794 2.75259856 2.73306796 2.71270601 2.69146902 2.68216245 2.65183252


2.63715073 2.62924744 2.63881923 2.65535241 2.67873584 2.70515715 2.72523291 2.76589971
2.79096061 2.80578169 2.81660561 2.82395491 2.82157726 2.81919394 2.811007785
2.80052807 2.786656]'

x4 =

2.7713

2.7526

2.7331

2.7127

2.6915

2.6822

2.6518

2.6372

2.6292

2.6388

2.6554

2.6787

2.7052

2.7252

2.7659

2.7910

2.8058
2.8166

2.8240

2.8216

2.8192

2.8110

2.8005

2.7867

>> x5=[-0.32501987 -0.32515274 -0.32528702 -0.32530087 -0.32515274 -0.32456738 -0.32388973


-0.32329958 -0.32793853 -0.32389388 -0.32590606 -0.32788343 -0.32949066 -0.33110049 -
0.33204226 -0.33235871 -0.33205202 -0.33107264 -0.32980074 -0.32841657 -0.32735612 -
0.32625244 -0.32559165 -0.32528702]'

x5 =

-0.3250

-0.3252

-0.3253

-0.3253

-0.3252

-0.3246

-0.3239

-0.3233

-0.3279

-0.3239

-0.3259

-0.3279

-0.3295

-0.3311

-0.3320
-0.3324

-0.3321

-0.3311

-0.3298

-0.3284

-0.3274

-0.3263

-0.3256

-0.3253

>> Y=[2.537657 2.475417 2.431857 2.388457 2.362111 2.338917 2.322061 2.356758 2.433028
2.635241 2.979095 3.186077 3.302604 3.349319 3.362688 3.339204 3.216740 3.091951 2.994398
2.897752 2.823361 2.742559 2.670464 2.600960]

Y=

Columns 1 through 12

2.5377 2.4754 2.4319 2.3885 2.3621 2.3389 2.3221 2.3568 2.4330 2.6352
2.9791 3.1861

Columns 13 through 24

3.3026 3.3493 3.3627 3.3392 3.2167 3.0920 2.9944 2.8978 2.8234 2.7426
2.6705 2.6010

>> y1=[2.537657 2.475417 2.431857 2.388457 2.362111 2.338917 2.322061 2.356758 2.433028
2.635241 2.979095 3.186077 3.302604 3.349319 3.362688 3.339204 3.216740 3.091951 2.994398
2.897752 2.823361 2.742559 2.670464 2.600960]'

y1 =
2.5377

2.4754

2.4319

2.3885

2.3621

2.3389

2.3221

2.3568

2.4330

2.6352

2.9791

3.1861

3.3026

3.3493

3.3627

3.3392

3.2167

3.0920

2.9944

2.8978

2.8234

2.7426

2.6705

2.6010

>> Y*y1

ans =
189.3161

>> B= [1.95 0.2794 -0.4611 0.00132 1.25870 4.67759]

B=

1.9500 0.2794 -0.4611 0.0013 1.2587 4.6776

>> X=[ones(size(x1)) x1 x2 x3 x4 x5]'

X=

Columns 1 through 12

1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000

1.7323 1.6512 1.6299 1.6273 1.6442 1.6499 1.6664 1.9218 2.2442 2.9131
3.3193 3.4567

4.0443 4.0837 4.1185 4.1472 4.1714 4.1888 4.2063 4.2264 4.2149 4.1066
3.7650 3.5104

3.1781 0 0.6931 1.0986 1.3863 1.6094 1.7918 1.9459 2.0794 2.1972 2.3026
2.3979

2.7713 2.7526 2.7331 2.7127 2.6915 2.6822 2.6518 2.6372 2.6292 2.6388
2.6554 2.6787

-0.3250 -0.3252 -0.3253 -0.3253 -0.3252 -0.3246 -0.3239 -0.3233 -0.3279 -0.3239 -
0.3259 -0.3279

Columns 13 through 24
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
1.0000 1.0000

3.5042 3.4774 3.3966 3.2305 2.8826 2.7083 2.4768 2.2457 2.1326 2.0373
1.9257 1.8245

3.3023 3.2218 3.0903 3.1455 3.3132 3.5282 3.6404 3.7344 3.8236 3.8954
3.9530 4.0039

2.4849 2.5649 2.6391 2.7081 2.7726 2.8332 2.8904 2.9444 2.9957 3.0445
3.0910 3.1355

2.7052 2.7252 2.7659 2.7910 2.8058 2.8166 2.8240 2.8216 2.8192 2.8110
2.8005 2.7867

-0.3295 -0.3311 -0.3320 -0.3324 -0.3321 -0.3311 -0.3298 -0.3284 -0.3274 -0.3263 -
0.3256 -0.3253

>> B*X*y1

ans =

188.8875

>> B= [1.95 0.2794 -0.4611 0.00132 1.25870 4.67759]

B=

1.9500 0.2794 -0.4611 0.0013 1.2587 4.6776

>> y1=[2.537657 2.475417 2.431857 2.388457 2.362111 2.338917 2.322061 2.356758 2.433028
2.635241 2.979095 3.186077 3.302604 3.349319 3.362688 3.339204 3.216740 3.091951 2.994398
2.897752 2.823361 2.742559 2.670464 2.600960]'

y1 =

2.5377
2.4754

2.4319

2.3885

2.3621

2.3389

2.3221

2.3568

2.4330

2.6352

2.9791

3.1861

3.3026

3.3493

3.3627

3.3392

3.2167

3.0920

2.9944

2.8978

2.8234

2.7426

2.6705

2.6010

>> B*X*y1

ans =

188.8875
>> y1=[2.537657 2.475417 2.431857 2.388457 2.362111 2.338917 2.322061 2.356758 2.433028
2.635241 2.979095 3.186077 3.302604 3.349319 3.362688 3.339204 3.216740 3.091951 2.994398
2.897752 2.823361 2.742559 2.670464 2.600960]^2

Error using ^

Inputs must be a scalar and a square matrix.

To compute elementwise POWER, use POWER (.^) instead.

>> y1=[2.537657 2.475417 2.431857 2.388457 2.362111 2.338917 2.322061 2.356758 2.433028
2.635241 2.979095 3.186077 3.302604 3.349319 3.362688 3.339204 3.216740 3.091951 2.994398
2.897752 2.823361 2.742559 2.670464 2.600960]^.2

Error using ^

Inputs must be a scalar and a square matrix.

To compute elementwise POWER, use POWER (.^) instead.

>> y1=[2.537657 2.475417 2.431857 2.388457 2.362111 2.338917 2.322061 2.356758 2.433028
2.635241 2.979095 3.186077 3.302604 3.349319 3.362688 3.339204 3.216740 3.091951 2.994398
2.897752 2.823361 2.742559 2.670464 2.600960].^2

y1 =

Columns 1 through 12

6.4397 6.1277 5.9139 5.7047 5.5796 5.4705 5.3920 5.5543 5.9196 6.9445
8.8750 10.1511

Columns 13 through 24

10.9072 11.2179 11.3077 11.1503 10.3474 9.5602 8.9664 8.3970 7.9714 7.5216
7.1314 6.7650

>> Y1=y1^2
Error using ^

Inputs must be a scalar and a square matrix.

To compute elementwise POWER, use POWER (.^) instead.

>> Y1=y1.^2

Y1 =

Columns 1 through 12

41.4698 37.5486 34.9745 32.5439 31.1316 29.9267 29.0733 30.8503 35.0420 48.2260
78.7657 103.0446

Columns 13 through 24

118.9669 125.8421 127.8634 124.3288 107.0690 91.3967 80.3967 70.5090 63.5427


56.5749 50.8566 45.7651

>> sum(y1^2)

Error using ^

Inputs must be a scalar and a square matrix.

To compute elementwise POWER, use POWER (.^) instead.

>> sum(y1.^2)

ans =

1.5957e+03
>> y1=[2.537657 2.475417 2.431857 2.388457 2.362111 2.338917 2.322061 2.356758 2.433028
2.635241 2.979095 3.186077 3.302604 3.349319 3.362688 3.339204 3.216740 3.091951 2.994398
2.897752 2.823361 2.742559 2.670464 2.600960].^2

y1 =

Columns 1 through 12

6.4397 6.1277 5.9139 5.7047 5.5796 5.4705 5.3920 5.5543 5.9196 6.9445
8.8750 10.1511

Columns 13 through 24

10.9072 11.2179 11.3077 11.1503 10.3474 9.5602 8.9664 8.3970 7.9714 7.5216
7.1314 6.7650

>> sum(y1)

ans =

189.3161

>> 189.3|61-189.168

ans =

>> (189.3|61-189.1680)
ans =

>> (189.3161-189.1680)

ans =

0.1481

>> (0.1481/18)

ans =

0.0082

>> t=0:24

t=

Columns 1 through 20

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Columns 21 through 25

20 21 22 23 24
>> y1=[2.537657 2.475417 2.431857 2.388457 2.362111 2.338917 2.322061 2.356758 2.433028
2.635241 2.979095 3.186077 3.302604 3.349319 3.362688 3.339204 3.216740 3.091951 2.994398
2.897752 2.823361 2.742559 2.670464 2.600960].^2

y1 =

Columns 1 through 12

6.4397 6.1277 5.9139 5.7047 5.5796 5.4705 5.3920 5.5543 5.9196 6.9445
8.8750 10.1511

Columns 13 through 24

10.9072 11.2179 11.3077 11.1503 10.3474 9.5602 8.9664 8.3970 7.9714 7.5216
7.1314 6.7650

>> plot(t), y1 '*r'

Error: "y1" was previously used as a variable, conflicting with its use here as the name of a
function or command.

See "How MATLAB Recognizes Command Syntax" in the MATLAB documentation for details.

>> plot(t),y1,'*r'

y1 =

Columns 1 through 12

6.4397 6.1277 5.9139 5.7047 5.5796 5.4705 5.3920 5.5543 5.9196 6.9445
8.8750 10.1511

Columns 13 through 24
10.9072 11.2179 11.3077 11.1503 10.3474 9.5602 8.9664 8.3970 7.9714 7.5216
7.1314 6.7650

ans =

*r

>> plot(,y1,t,y1'*r')

plot(,y1,t,y1'*r')

Error: Expression or statement is incorrect--possibly unbalanced (, {, or [.

>> polifit(x,y,3)

Undefined function or variable 'x'.

Did you mean:

>> polyfit(X,Y,3)

Error using polyfit (line 47)

X and Y vectors must be the same size.

>> r^2

Undefined function or variable 'r'.

>>

>> 'r'^2

ans =

Potrebbero piacerti anche