Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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.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.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.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.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=
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=
>> 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 ^
>> 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 ^
>> 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 ^
>> 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
>> sum(y1^2)
Error using ^
>> 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
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')
>> polifit(x,y,3)
>> polyfit(X,Y,3)
>> r^2
>>
>> 'r'^2
ans =