n = 10;
xs = 1 + 9*rand(n,1);
ys = .5 .* xs.^2 + 2 .* xs + randn(n,1);
plot( xs, ys, '*' )
ys = .5 .* xs.^2 + 2 .* xs + 5*randn(n,1);
plot( xs, ys, '*' )
edit least
close all
plot
{Error using plot
Not enough input arguments.
}
plot( xs, ys, '*' )
plot( xs, ys, '*' )
close all
plot( xs, ys, '*' )
hold on
plot( xs, ys, '*' )
plot( ys, xs, '*' )
hold off
plot( ys, xs, '*' )
least
k =
7.2065
-7.5870
least
least
least
M
M =
1.9609 1.0000
6.8838 1.0000
5.4476 1.0000
8.0115 1.0000
7.4353 1.0000
9.1335 1.0000
9.0183 1.0000
4.0075 1.0000
7.2887 1.0000
2.7803 1.0000
1.2749 1.0000
7.6967 1.0000
5.5002 1.0000
5.3193 1.0000
9.1425 1.0000
6.4888 1.0000
6.5590 1.0000
8.7350 1.0000
8.2494 1.0000
6.1905 1.0000
2.6463 1.0000
3.1594 1.0000
8.9786 1.0000
1.2581 1.0000
5.4091 1.0000
2.5113 1.0000
9.8081 1.0000
7.4143 1.0000
5.5042 1.0000
5.2398 1.0000
1.5366 1.0000
7.1377 1.0000
1.3819 1.0000
1.6430 1.0000
5.6948 1.0000
1.8706 1.0000
8.3633 1.0000
8.3579 1.0000
7.5020 1.0000
2.3488 1.0000
6.9364 1.0000
5.6674 1.0000
9.7568 1.0000
6.8409 1.0000
8.2030 1.0000
5.0842 1.0000
4.8915 1.0000
8.4278 1.0000
1.7512 1.0000
2.1985 1.0000
2.5605 1.0000
4.5184 1.0000
8.4824 1.0000
8.2303 1.0000
1.5442 1.0000
4.5933 1.0000
5.7419 1.0000
4.7512 1.0000
6.9117 1.0000
6.6518 1.0000
3.6279 1.0000
4.8849 1.0000
1.1394 1.0000
9.8566 1.0000
2.5045 1.0000
1.9559 1.0000
4.3517 1.0000
2.7831 1.0000
5.4072 1.0000
4.0554 1.0000
9.5647 1.0000
9.2830 1.0000
1.4741 1.0000
7.6407 1.0000
3.4221 1.0000
4.8055 1.0000
5.9308 1.0000
9.4846 1.0000
4.7597 1.0000
9.8475 1.0000
3.7131 1.0000
7.3099 1.0000
6.9970 1.0000
5.8521 1.0000
7.2829 1.0000
6.9988 1.0000
2.6032 1.0000
2.1521 1.0000
9.9917 1.0000
2.5401 1.0000
1.2934 1.0000
6.0508 1.0000
8.9368 1.0000
7.0226 1.0000
2.7139 1.0000
4.3202 1.0000
5.1465 1.0000
9.8347 1.0000
2.4076 1.0000
8.6997 1.0000
M = [ xs.^2 M ]
M =
3.8450 1.9609 1.0000
47.3869 6.8838 1.0000
29.6760 5.4476 1.0000
64.1836 8.0115 1.0000
55.2842 7.4353 1.0000
83.4205 9.1335 1.0000
81.3298 9.0183 1.0000
16.0598 4.0075 1.0000
53.1253 7.2887 1.0000
7.7300 2.7803 1.0000
1.6253 1.2749 1.0000
59.2387 7.6967 1.0000
30.2522 5.5002 1.0000
28.2949 5.3193 1.0000
83.5853 9.1425 1.0000
42.1045 6.4888 1.0000
43.0204 6.5590 1.0000
76.2999 8.7350 1.0000
68.0527 8.2494 1.0000
38.3222 6.1905 1.0000
7.0029 2.6463 1.0000
9.9817 3.1594 1.0000
80.6154 8.9786 1.0000
1.5827 1.2581 1.0000
29.2585 5.4091 1.0000
6.3069 2.5113 1.0000
96.1993 9.8081 1.0000
54.9711 7.4143 1.0000
30.2967 5.5042 1.0000
27.4555 5.2398 1.0000
2.3610 1.5366 1.0000
50.9474 7.1377 1.0000
1.9096 1.3819 1.0000
2.6995 1.6430 1.0000
32.4313 5.6948 1.0000
3.4990 1.8706 1.0000
69.9454 8.3633 1.0000
69.8549 8.3579 1.0000
56.2793 7.5020 1.0000
5.5168 2.3488 1.0000
48.1143 6.9364 1.0000
32.1189 5.6674 1.0000
95.1946 9.7568 1.0000
46.7982 6.8409 1.0000
67.2888 8.2030 1.0000
25.8489 5.0842 1.0000
23.9270 4.8915 1.0000
71.0282 8.4278 1.0000
3.0668 1.7512 1.0000
4.8336 2.1985 1.0000
6.5561 2.5605 1.0000
20.4163 4.5184 1.0000
71.9514 8.4824 1.0000
67.7375 8.2303 1.0000
2.3847 1.5442 1.0000
21.0986 4.5933 1.0000
32.9692 5.7419 1.0000
22.5739 4.7512 1.0000
47.7721 6.9117 1.0000
44.2459 6.6518 1.0000
13.1613 3.6279 1.0000
23.8619 4.8849 1.0000
1.2982 1.1394 1.0000
97.1520 9.8566 1.0000
6.2726 2.5045 1.0000
3.8257 1.9559 1.0000
18.9372 4.3517 1.0000
7.7455 2.7831 1.0000
29.2377 5.4072 1.0000
16.4466 4.0554 1.0000
91.4830 9.5647 1.0000
86.1739 9.2830 1.0000
2.1730 1.4741 1.0000
58.3806 7.6407 1.0000
11.7106 3.4221 1.0000
23.0930 4.8055 1.0000
35.1748 5.9308 1.0000
89.9583 9.4846 1.0000
22.6547 4.7597 1.0000
96.9727 9.8475 1.0000
13.7871 3.7131 1.0000
53.4345 7.3099 1.0000
48.9587 6.9970 1.0000
34.2475 5.8521 1.0000
53.0414 7.2829 1.0000
48.9825 6.9988 1.0000
6.7766 2.6032 1.0000
4.6317 2.1521 1.0000
99.8345 9.9917 1.0000
6.4521 2.5401 1.0000
1.6729 1.2934 1.0000
36.6122 6.0508 1.0000
79.8664 8.9368 1.0000
49.3166 7.0226 1.0000
7.3652 2.7139 1.0000
18.6646 4.3202 1.0000
26.4868 5.1465 1.0000
96.7221 9.8347 1.0000
5.7968 2.4076 1.0000
75.6849 8.6997 1.0000
least
least
edit filter
edit myfilter
least
myfilter
myfilter
{Undefined function or variable 'Pi'.
Error in myfilter (line 8)
axes([0 2*pi, -Pi/2, Pi])
}
myfilter
{Error using axes
Handles of type Root cannot be made the current Axes.
Error in myfilter (line 8)
axes([0 2*pi, -pi/2, pi])
}
myfilter
myfilter
matlab.internal.language.introspective.errorDocCallback('myfilter', '/Users/pauldj/works/courses/LSC/LSC-17/FPA/myfilter.m', 8)
myfilter
myfilter
myfilter
f =
Columns 1 through 3
1.7321 + 0.0000i 4.1113 - 4.0280i -0.9404 - 4.9470i
Columns 4 through 6
-2.0966 + 0.7455i -1.3388 + 0.2200i -1.2031 + 0.0000i
Columns 7 through 9
-1.3388 - 0.2200i -2.0966 - 0.7455i -0.9404 + 4.9470i
Column 10
4.1113 + 4.0280i
myfilter
myfilter
myfilter
myfilter
myfilter
myfilter
myfilter
{Undefined function or variable 'iffshift'.
Error in myfilter (line 23)
ifft(iffshift(f))
}
myfilter
ans =
Columns 1 through 3
0.0290 + 0.0002i 0.2674 + 0.0002i 0.5759 - 0.0004i
Columns 4 through 6
0.8399 + 0.0005i 1.1082 - 0.0004i 1.3655 + 0.0001i
Columns 7 through 9
1.6001 + 0.0003i 1.8256 - 0.0005i 2.0256 + 0.0005i
Columns 10 through 12
2.2055 - 0.0003i 2.3633 - 0.0000i 2.4927 + 0.0003i
Columns 13 through 15
2.5991 - 0.0005i 2.6765 + 0.0004i 2.7264 - 0.0002i
Columns 16 through 18
2.7499 - 0.0001i 2.7442 + 0.0004i 2.7130 - 0.0004i
Columns 19 through 21
2.6554 + 0.0003i 2.5724 - 0.0001i 2.4673 - 0.0002i
Columns 22 through 24
2.3395 + 0.0003i 2.1928 - 0.0003i 2.0290 + 0.0002i
Columns 25 through 27
1.8494 + 0.0000i 1.6584 - 0.0002i 1.4570 + 0.0003i
Columns 28 through 30
1.2485 - 0.0002i 1.0364 + 0.0001i 0.8216 + 0.0001i
Columns 31 through 33
0.6086 - 0.0002i 0.3991 + 0.0002i 0.1950 - 0.0001i
Columns 34 through 36
0.0003 - 0.0000i -0.1850 + 0.0002i -0.3574 - 0.0002i
Columns 37 through 39
-0.5156 + 0.0001i -0.6591 - 0.0000i -0.7851 - 0.0001i
Columns 40 through 42
-0.8943 + 0.0002i -0.9854 - 0.0001i -1.0576 + 0.0000i
Columns 43 through 45
-1.1124 + 0.0001i -1.1481 - 0.0002i -1.1667 + 0.0001i
Columns 46 through 48
-1.1688 - 0.0001i -1.1542 - 0.0001i -1.1261 + 0.0002i
Columns 49 through 51
-1.0840 - 0.0002i -1.0304 + 0.0001i -0.9674 + 0.0001i
Columns 52 through 54
-0.8954 - 0.0002i -0.8179 + 0.0002i -0.7355 - 0.0002i
Columns 55 through 57
-0.6506 + 0.0000i -0.5655 + 0.0002i -0.4807 - 0.0003i
Columns 58 through 60
-0.3994 + 0.0002i -0.3224 - 0.0001i -0.2509 - 0.0001i
Columns 61 through 63
-0.1871 + 0.0003i -0.1311 - 0.0003i -0.0844 + 0.0002i
Columns 64 through 66
-0.0478 - 0.0000i -0.0210 - 0.0002i -0.0053 + 0.0004i
Columns 67 through 69
-0.0000 - 0.0004i -0.0051 + 0.0002i -0.0205 + 0.0001i
Columns 70 through 72
-0.0451 - 0.0003i -0.0784 + 0.0004i -0.1198 - 0.0004i
Columns 73 through 75
-0.1673 + 0.0001i -0.2208 + 0.0002i -0.2782 - 0.0004i
Columns 76 through 78
-0.3379 + 0.0005i -0.3999 - 0.0003i -0.4606 + 0.0000i
Columns 79 through 81
-0.5203 + 0.0003i -0.5773 - 0.0005i -0.6286 + 0.0005i
Columns 82 through 84
-0.6760 - 0.0003i -0.7150 - 0.0001i -0.7465 + 0.0004i
Columns 85 through 87
-0.7705 - 0.0005i -0.7823 + 0.0004i -0.7870 - 0.0002i
Columns 88 through 90
-0.7794 - 0.0002i -0.7607 + 0.0005i -0.7347 - 0.0005i
Columns 91 through 93
-0.6931 + 0.0004i -0.6465 - 0.0000i -0.5886 - 0.0003i
Columns 94 through 96
-0.5186 + 0.0005i -0.4503 - 0.0005i -0.3625 + 0.0003i
Columns 97 through 99
-0.2794 + 0.0001i -0.1944 - 0.0004i -0.0794 + 0.0005i
Column 100
-0.0282 - 0.0005i
myfilter
myfilter
myfilter
f =
Columns 1 through 3
-0.4431 + 0.0000i -0.4605 - 0.0130i -0.5256 - 0.0301i
Columns 4 through 6
-0.7082 - 0.0624i -1.6214 - 0.1987i 1.5324 + 0.2504i
Columns 7 through 9
0.3604 + 0.0782i 0.1477 + 0.0442i 0.0604 + 0.0285i
Columns 10 through 12
0.0135 + 0.0189i -0.0157 + 0.0120i -0.0355 + 0.0066i
Columns 13 through 15
-0.0500 + 0.0020i -0.0611 - 0.0020i -0.0701 - 0.0056i
Columns 16 through 18
-0.0777 - 0.0090i -0.0843 - 0.0122i -0.0902 - 0.0153i
Columns 19 through 21
-0.0958 - 0.0184i -0.1012 - 0.0214i -0.1064 - 0.0244i
Columns 22 through 24
-0.1118 - 0.0275i -0.1173 - 0.0306i -0.1231 - 0.0338i
Columns 25 through 27
-0.1293 - 0.0371i -0.1360 - 0.0405i -0.1433 - 0.0441i
Columns 28 through 30
-0.1515 - 0.0479i -0.1606 - 0.0519i -0.1709 - 0.0562i
Columns 31 through 33
-0.1826 - 0.0608i -0.1962 - 0.0658i -0.2120 - 0.0712i
Columns 34 through 36
-0.2307 - 0.0772i -0.2529 - 0.0838i -0.2797 - 0.0912i
Columns 37 through 39
-0.3124 - 0.0997i -0.3530 - 0.1093i -0.4044 - 0.1205i
Columns 40 through 42
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 43 through 45
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 46 through 48
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 49 through 51
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 52 through 54
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 55 through 57
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 58 through 60
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 61 through 63
-0.5585 + 0.1498i -0.4707 + 0.1338i -0.4044 + 0.1205i
Columns 64 through 66
-0.3530 + 0.1093i -0.3124 + 0.0997i -0.2797 + 0.0912i
Columns 67 through 69
-0.2529 + 0.0838i -0.2307 + 0.0772i -0.2120 + 0.0712i
Columns 70 through 72
-0.1962 + 0.0658i -0.1826 + 0.0608i -0.1709 + 0.0562i
Columns 73 through 75
-0.1606 + 0.0519i -0.1515 + 0.0479i -0.1433 + 0.0441i
Columns 76 through 78
-0.1360 + 0.0405i -0.1293 + 0.0371i -0.1231 + 0.0338i
Columns 79 through 81
-0.1173 + 0.0306i -0.1118 + 0.0275i -0.1064 + 0.0244i
Columns 82 through 84
-0.1012 + 0.0214i -0.0958 + 0.0184i -0.0902 + 0.0153i
Columns 85 through 87
-0.0843 + 0.0122i -0.0777 + 0.0090i -0.0701 + 0.0056i
Columns 88 through 90
-0.0611 + 0.0020i -0.0500 - 0.0020i -0.0355 - 0.0066i
Columns 91 through 93
-0.0157 - 0.0120i 0.0135 - 0.0189i 0.0604 - 0.0285i
Columns 94 through 96
0.1477 - 0.0442i 0.3604 - 0.0782i 1.5324 - 0.2504i
Columns 97 through 99
-1.6214 + 0.1987i -0.7082 + 0.0624i -0.5256 + 0.0301i
Column 100
-0.4605 + 0.0130i
myfilter
f =
Columns 1 through 3
-0.4431 + 0.0000i -0.4605 - 0.0130i -0.5256 - 0.0301i
Columns 4 through 6
-0.7082 - 0.0624i -1.6214 - 0.1987i 1.5324 + 0.2504i
Columns 7 through 9
0.3604 + 0.0782i 0.1477 + 0.0442i 0.0604 + 0.0285i
Columns 10 through 12
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 13 through 15
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 16 through 18
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 19 through 21
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 22 through 24
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 25 through 27
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 28 through 30
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 31 through 33
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 34 through 36
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 37 through 39
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 40 through 42
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 43 through 45
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 46 through 48
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 49 through 51
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 52 through 54
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 55 through 57
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 58 through 60
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 61 through 63
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 64 through 66
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 67 through 69
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 70 through 72
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 73 through 75
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 76 through 78
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 79 through 81
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 82 through 84
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 85 through 87
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 88 through 90
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 91 through 93
-0.0157 - 0.0120i 0.0135 - 0.0189i 0.0604 - 0.0285i
Columns 94 through 96
0.1477 - 0.0442i 0.3604 - 0.0782i 1.5324 - 0.2504i
Columns 97 through 99
-1.6214 + 0.1987i -0.7082 + 0.0624i -0.5256 + 0.0301i
Column 100
-0.4605 + 0.0130i
myfilter
f =
Columns 1 through 3
-0.7345 + 0.0000i -0.7519 - 0.0236i -0.8169 - 0.0514i
Columns 4 through 6
-0.9994 - 0.0945i -1.9123 - 0.2416i 1.2417 + 0.1967i
Columns 7 through 9
0.0700 + 0.0134i -0.1422 - 0.0318i -0.2290 - 0.0588i
Columns 10 through 12
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 13 through 15
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 16 through 18
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 19 through 21
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 22 through 24
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 25 through 27
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 28 through 30
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 31 through 33
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 34 through 36
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 37 through 39
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 40 through 42
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 43 through 45
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 46 through 48
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 49 through 51
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 52 through 54
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 55 through 57
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 58 through 60
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 61 through 63
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 64 through 66
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 67 through 69
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 70 through 72
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 73 through 75
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 76 through 78
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 79 through 81
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 82 through 84
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 85 through 87
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 88 through 90
0.0000 + 0.0000i 0.0000 + 0.0000i 0.0000 + 0.0000i
Columns 91 through 93
-0.3040 + 0.0988i -0.2755 + 0.0800i -0.2290 + 0.0588i
Columns 94 through 96
-0.1422 + 0.0318i 0.0700 - 0.0134i 1.2417 - 0.1967i
Columns 97 through 99
-1.9123 + 0.2416i -0.9994 + 0.0945i -0.8169 + 0.0514i
Column 100
-0.7519 + 0.0236i
sqrt(sqrt(sqrt(sqrt((((2^2)^2)^2)^2)
sqrt(sqrt(sqrt(sqrt((((2^2)^2)^2)^2)
|
{Error: Expression or statement is incorrect--possibly unbalanced (, {, or
[.
}
sqrt(sqrt(sqrt(sqrt((((2^2)^2)^2)^2)))))
sqrt(sqrt(sqrt(sqrt((((2^2)^2)^2)^2)))))
|
{Error: Unbalanced or unexpected parenthesis or bracket.
}
sqrt(sqrt(sqrt(sqrt( ((((2^2)^2)^2)^2)))))
ans =
2
sqrt(sqrt(sqrt(sqrt( 2^(2^(2^(2^2)) )))))
ans =
Inf
[pi pi pi pi]*[1 -1 1 -1]'
ans =
0
[pi [pi pi] pi]*[1 -1 1 -1]'
ans =
0
[pi [[pi [pi]] pi]]*[1 -1 1 -1]'
ans =
0
edit Mv
Mv( [1 2 3 4]' )
ans =
17
17
43
43
Mv( [1 2 3 4]' )
Elapsed time is 0.000020 seconds.
Elapsed time is 0.000046 seconds.
{Error using -
Matrix dimensions must agree.
Error in Mv (line 20)
norm( y - y2 )
}
Mv( [1 2 3 4]' )
Elapsed time is 0.000006 seconds.
Elapsed time is 0.000041 seconds.
ans =
4 1
ans =
1 4
{Error using -
Matrix dimensions must agree.
Error in Mv (line 23)
norm( y - y2 )
}
Mv( [1 2 3 4]' )
Elapsed time is 0.000008 seconds.
Elapsed time is 0.000197 seconds.
ans =
4 1
ans =
4 1
ans =
0
ans =
17
17
43
43
Mv( rand(100,1) )
Elapsed time is 0.000742 seconds.
Elapsed time is 0.000063 seconds.
ans =
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
81.1268
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
213.1778
Mv( rand(100,1) );
Elapsed time is 0.000073 seconds.
Elapsed time is 0.000060 seconds.
Mv( rand(1000,1) );
Elapsed time is 0.000209 seconds.
Elapsed time is 0.000047 seconds.
Mv( rand(10000,1) );
Elapsed time is 0.040719 seconds.
Elapsed time is 0.000105 seconds.
Mv( rand(10000,1) );
Elapsed time is 0.041286 seconds.
Elapsed time is 0.000103 seconds.