Documentos de Académico
Documentos de Profesional
Documentos de Cultura
5 y elemento inicial
3.5.definir un vector columna b de 100 elementos , con un paso de 2 y elemento inicial
6.>> a=3.5:0.5:53
a=
Columns 1 through 7
3.5000 4.0000 4.5000 5.0000 5.5000 6.0000 6.5000
Columns 8 through 14
7.0000 7.5000 8.0000 8.5000 9.0000 9.5000 10.0000
Columns 15 through 21
10.5000 11.0000 11.5000 12.0000 12.5000 13.0000 13.5000
Columns 22 through 28
14.0000 14.5000 15.0000 15.5000 16.0000 16.5000 17.0000
Columns 29 through 35
17.5000 18.0000 18.5000 19.0000 19.5000 20.0000 20.5000
Columns 36 through 42
21.0000 21.5000 22.0000 22.5000 23.0000 23.5000 24.0000
Columns 43 through 49
24.5000 25.0000 25.5000 26.0000 26.5000 27.0000 27.5000
Columns 50 through 56
28.0000 28.5000 29.0000 29.5000 30.0000 30.5000 31.0000
Columns 57 through 63
31.5000 32.0000 32.5000 33.0000 33.5000 34.0000 34.5000
Columns 64 through 70
35.0000 35.5000 36.0000 36.5000 37.0000 37.5000 38.0000
Columns 71 through 77
38.5000 39.0000 39.5000 40.0000 40.5000 41.0000 41.5000
Columns 78 through 84
42.0000 42.5000 43.0000 43.5000 44.0000 44.5000 45.0000
Columns 85 through 91
45.5000 46.0000 46.5000 47.0000 47.5000 48.0000 48.5000
Columns 92 through 98
49.0000 49.5000 50.0000 50.5000 51.0000 51.5000 52.0000
Columns 99 through 100
52.5000 53.0000
>> B=6:2:206
B=
Columns 1 through 11
6 8 10 12 14 16
Columns 12 through 22
28 30 32 34 36 38
Columns 23 through 33
50 52 54 56 58 60
Columns 34 through 44
72 74 76 78 80 82
18 20 22 24 26
40 42 44 46 48
62 64 66 68 70
84 86 88 90 92
Columns 45 through 55
94 96 98 100 102 104 106 108 110 112 114
Columns 56 through 66
116 118 120 122 124 126 128 130 132 134 136
Columns 67 through 77
138 140 142 144 146 148 150 152 154 156 158
Columns 78 through 88
160 162 164 166 168 170 172 174 176 178 180
Columns 89 through 99
182 184 186 188 190 192 194 196 198 200 202
Columns 100
204
A) defina una variable que contenga el elemento 43 del vector del vector a y otra que
contenga el elemento 77 del vector b.
>> w=a(43)
w = 24.5000
>> g=B(77)
g=
158
c) realizar las siguientes operaciones con los vectores ayb :suma ,resta multiplicacin y
divisin (elemento a elemento).
>> a+B
ans =
Columns 1 through 7
9.5000 12.0000 14.5000 17.0000 19.5000 22.0000 24.5000
Columns 8 through 14
27.0000 29.5000 32.0000 34.5000 37.0000 39.5000 42.0000
Columns 15 through 21
44.5000 47.0000 49.5000 52.0000 54.5000 57.0000 59.5000
Columns 22 through 28
62.0000 64.5000 67.0000 69.5000 72.0000 74.5000 77.0000
Columns 29 through 35
79.5000 82.0000 84.5000 87.0000 89.5000 92.0000 94.5000
Columns 36 through 42
97.0000 99.5000 102.0000 104.5000 107.0000 109.5000 112.0000
Columns 43 through 49
114.5000 117.0000 119.5000 122.0000 124.5000 127.0000 129.5000
Columns 50 through 56
132.0000 134.5000 137.0000 139.5000 142.0000 144.5000 147.0000
Columns 57 through 63
149.5000 152.0000 154.5000 157.0000 159.5000 162.0000 164.5000
Columns 64 through 70
167.0000 169.5000 172.0000 174.5000 177.0000 179.5000 182.0000
Columns 71 through 77
184.5000 187.0000 189.5000 192.0000 194.5000 197.0000 199.5000
Columns 78 through 84
202.0000 204.5000 207.0000 209.5000 212.0000 214.5000 217.0000
Columns 85 through 91
219.5000 222.0000 224.5000 227.0000 229.5000 232.0000 234.5000
Columns 92 through 98
237.0000 239.5000 242.0000 244.5000 247.0000 249.5000 252.0000
Columns 99 through 100 254.5000 257.0000
>> a-B
ans =
Columns 1 through 7
-2.5000 -4.0000 -5.5000 -7.0000 -8.5000 -10.0000 -11.5000
Columns 8 through 14
-13.0000 -14.5000 -16.0000 -17.5000 -19.0000 -20.5000 -22.0000
Columns 15 through 21
-23.5000 -25.0000 -26.5000 -28.0000 -29.5000 -31.0000 -32.5000
Columns 22 through 28
-34.0000 -35.5000 -37.0000 -38.5000 -40.0000 -41.5000 -43.0000
Columns 29 through 35
-44.5000 -46.0000 -47.5000 -49.0000 -50.5000 -52.0000 -53.5000
Columns 36 through 42
-55.0000 -56.5000 -58.0000 -59.5000 -61.0000 -62.5000 -64.0000
Columns 43 through 49
-65.5000 -67.0000 -68.5000 -70.0000 -71.5000 -73.0000 -74.5000
Columns 50 through 56
-76.0000 -77.5000 -79.0000 -80.5000 -82.0000 -83.5000 -85.0000
Columns 57 through 63
-86.5000 -88.0000 -89.5000 -91.0000 -92.5000 -94.0000 -95.5000
Columns 64 through 70
-97.0000 -98.5000 -100.0000 -101.5000 -103.0000 -104.5000 -106.0000
Columns 71 through 77
-107.5000 -109.0000 -110.5000 -112.0000 -113.5000 -115.0000 -116.5000
Columns 78 through 84
-118.0000 -119.5000 -121.0000 -122.5000 -124.0000 -125.5000 -127.0000
Columns 85 through 91
-128.5000 -130.0000 -131.5000 -133.0000 -134.5000 -136.0000 -137.5000
Columns 92 through 98
-139.0000 -140.5000 -142.0000 -143.5000 -145.0000 -146.5000 -148.0000
Columns 99 through 100
-149.5000 -151.0000
>> a.*B
ans =
Columns 1 through 5
21
32
45
Columns 6 through 10
96
117
140
Columns 11 through 15
221
252
285
Columns 16 through 20
396
437
480
Columns 21 through 25
60
77
165
192
320
357
525
572
621
672
725
Columns 26 through 30
896
957
1020
Columns 31 through 35
1221
1292
1365
Columns 36 through 40
1596
1677
1760
Columns 41 through 45
2021
2112
2205
Columns 46 through 50
2496
2597
2700
Columns 51 through 55
3021
3132
3245
Columns 56 through 60
3596
3717
3840
Columns 61 through 65
4221
4352
4485
Columns 66 through 70
4896
5037
5180
Columns 71 through 75
5621
5772
5925
Columns 76 through 80
6396
6557
6720
Columns 81 through 85
7221
7392
7565
Columns 86 through 90
8096
8277
8460
Columns 91 through 95
9021
9212
9405
Columns 96 through 100
9996
10197
10400
780
1085
837
1152
1440
1517
1845
1932
2300
2397
2805
2912
3360
3477
3965
4092
4620
4757
5325
5472
6080
6237
6885
7052
7740
7917
8645
8832
9600
9797
10605
10812
>> a./B
ans =
Columns 1 through 7
0.5833 0.5000 0.4500 0.4167 0.3929 0.3750 0.3611
Columns 8 through 14
0.3500 0.3409 0.3333 0.3269 0.3214 0.3167 0.3125
Columns 15 through 21
0.3088 0.3056 0.3026 0.3000 0.2976 0.2955 0.2935
Columns 22 through 28
0.2917 0.2900 0.2885 0.2870 0.2857
Columns 29 through 35
0.2823 0.2813 0.2803 0.2794 0.2786
Columns 36 through 42
0.2763 0.2756 0.2750 0.2744 0.2738
Columns 43 through 49
0.2722 0.2717 0.2713 0.2708 0.2704
Columns 50 through 56
0.2692 0.2689 0.2685 0.2682 0.2679
Columns 57 through 63
0.2669 0.2667 0.2664 0.2661 0.2659
Columns 64 through 70
0.2652 0.2649 0.2647 0.2645 0.2643
Columns 71 through 77
0.2637 0.2635 0.2633 0.2632 0.2630
Columns 78 through 84
0.2625 0.2623 0.2622 0.2620 0.2619
Columns 85 through 91
0.2615 0.2614 0.2612 0.2611 0.2610
Columns 92 through 98
0.2606 0.2605 0.2604 0.2603 0.2602
Columns 99 through 100 0.2599 0.2598
0.2845 0.2833
0.2778 0.2770
0.2733 0.2727
0.2700 0.2696
0.2675 0.2672
0.2656 0.2654
0.2641 0.2639
0.2628 0.2627
0.2618 0.2616
0.2609 0.2608
0.2601 0.2600
90 95 100 105
140 145 150 155 160
195 200 205 210 215
250 255 260 265 270
305 310 315 320 325
360 365 370 375 380
415 420 425 430 435
470 475 480
Columns 36 through 42
15.1658 15.3297 15.4919
Columns 43 through 49
16.2788 16.4317 16.5831
Columns 50 through 56
17.3205 17.4642 17.6068
Columns 57 through 63
18.3030 18.4391 18.5742
Columns 64 through 70
19.2354 19.3649 19.4936
Columns 71 through 77
20.1246 20.2485 20.3715
Columns 78 through 84
20.9762 21.0950 21.2132
Columns 85 through 86
21.7945 21.9089
170
175
180
185
190
195
200
205
210
215
220
225
230
235
240
245
250
255
260
265
270
275
280
285
290
295
300
305
310
315
320
325
330
335
340
345
350
355
360
365
370
375
380
385
390
395
400
405
410
415
420
425
430
435
440
445
450
455
460
465
470
475
480
>> u'
ans =
7.4162
7.7460
8.0623
8.3666
8.6603
8.9443
9.2195
9.4868
9.7468
10.0000
10.2470
10.4881
10.7238
10.9545
11.1803
11.4018
11.6190
11.8322
12.0416
12.2474
12.4499
12.6491
12.8452
13.0384
13.2288
13.4164
13.6015
13.7840
13.9642
14.1421
14.3178
14.4914
14.6629
14.8324
15.0000
15.1658
15.3297
15.4919
15.6525
15.8114
15.9687
16.1245
16.2788
16.4317
16.5831
16.7332
16.8819
17.0294
17.1756
17.3205
17.4642
17.6068
17.7482
17.8885
18.0278
18.1659
18.3030
18.4391
18.5742
18.7083
18.8414
18.9737
19.1050
19.2354
19.3649
19.4936
19.6214
19.7484
19.8746
20.0000
20.1246
20.2485
20.3715
20.4939
20.6155
20.7364
20.8567
20.9762
21.0950
21.2132
21.3307
21.4476
21.5639
21.6795
21.7945
21.9089
Columns 1 through 7
0.1348 0.1291 0.1240
Columns 8 through 14
0.1054 0.1026 0.1000
Columns 15 through 21
0.0894 0.0877 0.0861
Columns 22 through 28
0.0791 0.0778 0.0767
Columns 29 through 35
0.0716 0.0707 0.0698
Columns 36 through 42
0.0659 0.0652 0.0645
Columns 43 through 49
0.0614 0.0609 0.0603
Columns 50 through 56
0.0577 0.0573 0.0568
Columns 57 through 63
0.0546 0.0542 0.0538
Columns 64 through 70
0.0520 0.0516 0.0513
Columns 71 through 77
0.0497 0.0494 0.0491
Columns 78 through 84
0.0477 0.0474 0.0471
Columns 85 through 86
0.0459 0.0456
c) definir una variable que contenga la suma de los elementos del vector q, el mximo del
vector t y el mnimo del vector s.
>> s = suma_vec (q)
s=
1978430
>> max(t)
ans =
0.1348
Definir una variable que sea el producto escalar de los vectores u y v.
>> x=u.*v
Columns 1 through 7
0.0408 0.0465 0.0524
Columns 8 through 14
0.0854 0.0926 0.1000
Columns 15 through 21
0.1398 0.1482 0.1569
Columns 22 through 28
0.2024 0.2119 0.2217
Columns 29 through 35
0.2723 0.2828 0.2935
Columns 36 through 42
0.3488 0.3602 0.3718
Columns 43 through 49
0.4314 0.4437 0.4560
Columns 50 through 56
0.5196 0.5327 0.5458
Columns 57 through 63
0.6132 0.6269 0.6408
Columns 64 through 70
0.7117 0.7262 0.7408
Columns 71 through 77
0.8150 0.8302 0.8454
Columns 78 through 84
0.9230 0.9387 0.9546
Columns 85 through 86
1.0352 1.0516
g) definir una variable que contenga los 3 primeros elementos del vector u y otra que contenga
los ltimos 3 del vector v. calcular el producto vectorial de ambas variables.
j = 7.4162 7.7460 8.0623
b=
2
3 -7
>> norm(b,2)
Ans =
7.8740
b) C=A+B
>> C=a+b
C=
5 -1 -3
c) D=2A-B
>> D=(a.*2)-b
D=
4 -11 15
4) sean los vectores filas u y w definidos de la siguiente forma .u=[10,-11,12] w=[2,1,3]
>> u.*w
ans = 20 -11 36
>> a.*b
Ans =
-6 12
e) calcular el inverso de A.
>> inv(A)
ans =
-3.0000 2.0000 -8.0000
7.0000 -4.0000 17.0000
-5.0000 3.0000 -12.0000
f) calcular el determinante de B
>> det(B)
ans =
-49.0000
g) definir una nueva matriz D tal que dij=aij*bij
>> A*B
ans =
-3 1 13
16 13 -20
5 3 -10
>> ij=[1,1,1;1,1,1;1,1,1]
ij =
1
1
1
1
1
1
1
1
1
>> D= ij*(A*B)
ans =
18 17 -17
18 17 -17
18 17 -17
7) construya 3 vectores columna, de modo que la diferencia entre dos elementos consecutivos
sea 0.4 para el primero, 0.6 para el segundo y 2 para el tercero.
x=
0
0.4000
0.8000
1.2000
1.6000
2.0000
2.4000
2.8000
3.2000
3.6000
4.0000
4.4000
4.8000
5.2000
5.6000
6.0000
6.4000
6.8000
7.2000
7.6000
y=
0
0.6000
1.2000
1.8000
2.4000
3.0000
3.6000
4.2000
4.8000
5.4000
6.0000
6.6000
7.2000
7.8000
8.4000
9.0000
9.6000
10.2000
10.8000
11.4000
z=
0
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
a) construir una matriz de 20 filas por 3 columnas con los vectores definidos anteriormente.
R=
0
0.4000
0.8000
1.2000
1.6000
2.0000
2.4000
2.8000
3.2000
3.6000
4.4000
4.8000
5.2000
5.4000
5.6000
6.0000
6.4000
6.8000
7.2000
7.6000
0
0.6000
1.2000
1.8000
2.4000
3.0000
3.6000
4.2000
4.8000
5.4000
6.0000
6.6000
7.2000
7.8000
8.4000
9.0000
9.6000
10.2000
10.8000
11.4000
0
2
4
6
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
9) construya las siguientes graficas, definiendo el vector x con 50 puntos. Poner titulo a cada
grafica as como nombres a los ejes:
a) funcin ex, con x definido en el intervalo (0.5, 2.5).
>> x=0.5:0.0408:2.5
x=
Columns 1 through 9
0.5000 0.5408 0.5816 0.6224 0.6632 0.7040
Columns 10 through 18
0.8672 0.9080 0.9488 0.9896 1.0304 1.0712
Columns 19 through 27
1.2344 1.2752 1.3160 1.3568 1.3976 1.4384
Columns 28 through 36
1.6016 1.6424 1.6832 1.7240 1.7648 1.8056
Columns 37 through 45
1.9688 2.0096 2.0504 2.0912 2.1320 2.1728
Columns 46 through 50
2.3360 2.3768 2.4176 2.4584 2.4992
>> exp(x)
ans =
Columns 1 through 9
1.6487 1.7174 1.7889 1.8634 1.9410 2.0218
Columns 10 through 18
2.3802 2.4794 2.5826 2.6902 2.8022 2.9189
Columns 19 through 27
3.4363 3.5794 3.7285 3.8837 4.0455 4.2139
Columns 28 through 36
4.9610 5.1676 5.3828 5.6069 5.8404 6.0836
Columns 37 through 45
7.1621 7.4603 7.7710 8.0946 8.4317 8.7828
Columns 46 through 50
10.3398 10.7704 11.2189 11.6861 12.1728
x
Funcin
>> sin(x)
ans =
Columns 1 through 9
0 0.2487 0.4817 0.6845 0.8443 0.9510 0.9980 0.9823 0.9049
Columns 10 through 18
0.7707 0.5880 0.3684 0.1257 -0.1250 -0.3678 -0.5875 -0.7702 -0.9046
Columns 19 through 27
-0.9822 -0.9981 -0.9512 -0.8446 -0.6850 -0.4823 -0.2493 -0.0007 0.2480
Columns 28 through 36
0.4811 0.6840 0.8439 0.9508 0.9980 0.9825 0.9052 0.7711 0.5886
Columns 37 through 45
0.3690 0.1263 -0.1243 -0.3671 -0.5869 -0.7698 -0.9043 -0.9821 -0.9981
Columns 46 through 50
-0.9514 -0.8450 -0.6855 -0.4829 -0.2500
Funcin seno de x
10) grafique las funciones: y=cos(X) e y=x, para o<x<2, en la misma ventana , con 100 puntos c/u.
Aplique el comando zoom para determinar en forma aproximada el punto de interseccin;
investigue el comando ginput. Implemente un algoritmo que le permia hallar el punto de
interseccin entre ambas funciones.
>> x=0:.0202:2
x=
Columns 1 through 9
0 0.0202 0.0404 0.0606 0.0808 0.1010 0.1212 0.1414 0.1616
Columns 10 through 18
0.1818 0.2020 0.2222 0.2424 0.2626 0.2828 0.3030 0.3232 0.3434
Columns 19 through 27
0.3636 0.3838 0.4040 0.4242 0.4444 0.4646 0.4848 0.5050 0.5252
Columns 28 through 36
0.5454 0.5656 0.5858 0.6060 0.6262 0.6464 0.6666 0.6868 0.7070
Columns 37 through 45
0.7272 0.7474 0.7676 0.7878 0.8080 0.8282 0.8484 0.8686 0.8888
Columns 46 through 54
0.9090 0.9292 0.9494 0.9696 0.9898 1.0100 1.0302 1.0504 1.0706
Columns 55 through 63
1.0908 1.1110 1.1312 1.1514 1.1716 1.1918 1.2120 1.2322 1.2524
Columns 64 through 72
1.2726 1.2928 1.3130 1.3332 1.3534 1.3736 1.3938 1.4140 1.4342
Columns 73 through 81
1.4544 1.4746 1.4948 1.5150 1.5352 1.5554 1.5756 1.5958 1.6160
Columns 82 through 90
1.6362 1.6564 1.6766 1.6968 1.7170 1.7372 1.7574 1.7776 1.7978
Columns 91 through 99
Columns 19 through 27
0.1800 0.1900 0.2000 0.2100 0.2200 0.2300 0.2400 0.2500 0.2600
Columns 28 through 36
0.2700 0.2800 0.2900 0.3000 0.3100 0.3200 0.3300 0.3400 0.3500
Columns 37 through 45
0.3600 0.3700 0.3800 0.3900 0.4000 0.4100 0.4200 0.4300 0.4400
Columns 46 through 54
0.4500 0.4600 0.4700 0.4800 0.4900 0.5000 0.5100 0.5200 0.5300
Columns 55 through 63
0.5400 0.5500 0.5600 0.5700 0.5800 0.5900 0.6000 0.6100 0.6200
Columns 64 through 72
0.6300 0.6400 0.6500 0.6600 0.6700 0.6800 0.6900 0.7000 0.7100
Columns 73 through 81
0.7200 0.7300 0.7400 0.7500 0.7600 0.7700 0.7800 0.7900 0.8000
Columns 82 through 90
0.8100 0.8200 0.8300 0.8400 0.8500 0.8600 0.8700 0.8800 0.8900
Columns 91 through 99
0.9000 0.9100 0.9200 0.9300 0.9400 0.9500 0.9600 0.9700 0.9800
Columns 100 through 101
0.9900 1.0000
>> y1=sin(3*pi*x)
y1 =
Columns 1 through 9
0 0.0941 0.1874 0.2790 0.3681 0.4540 0.5358 0.6129 0.6845
Columns 10 through 18
0.7501 0.8090 0.8607 0.9048 0.9409 0.9686 0.9877 0.9980 0.9995
Columns 19 through 27
0.9921 0.9759 0.9511 0.9178 0.8763 0.8271 0.7705 0.7071 0.6374
Columns 28 through 36
0.5621 0.4818 0.3971 0.3090 0.2181 0.1253 0.0314 -0.0628 -0.1564
Columns 37 through 45
-0.2487 -0.3387 -0.4258 -0.5090 -0.5878 -0.6613 -0.7290 -0.7902 -0.8443
Columns 46 through 54
-0.8910 -0.9298 -0.9603 -0.9823 -0.9956 -1.0000 -0.9956 -0.9823 -0.9603
Columns 55 through 63
-0.9298 -0.8910 -0.8443 -0.7902 -0.7290 -0.6613 -0.5878 -0.5090 -0.4258
Columns 64 through 72
-0.3387 -0.2487 -0.1564 -0.0628 0.0314 0.1253 0.2181 0.3090 0.3971
Columns 73 through 81
0.4818 0.5621 0.6374 0.7071 0.7705 0.8271 0.8763 0.9178 0.9511
Columns 82 through 90
0.9759 0.9921 0.9995 0.9980 0.9877 0.9686 0.9409 0.9048 0.8607
Columns 91 through 99
0.8090 0.7501 0.6845 0.6129 0.5358 0.4540 0.3681 0.2790 0.1874
Columns 100 through 101
0.0941 0.0000
>> y2=cos(3*pi*x)
y2 =
Columns 1 through 9
1.0000 0.9956 0.9823 0.9603 0.9298 0.8910 0.8443 0.7902 0.7290
Columns 10 through 18
0.6613 0.5878 0.5090 0.4258 0.3387 0.2487 0.1564 0.0628 -0.0314
Columns 19 through 27
-0.1253 -0.2181 -0.3090 -0.3971 -0.4818 -0.5621 -0.6374 -0.7071 -0.7705
Columns 28 through 36
-0.8271 -0.8763 -0.9178 -0.9511 -0.9759 -0.9921 -0.9995 -0.9980 -0.9877
Columns 37 through 45
-0.9686 -0.9409 -0.9048 -0.8607 -0.8090 -0.7501 -0.6845 -0.6129 -0.5358
Columns 46 through 54
-0.4540 -0.3681 -0.2790 -0.1874 -0.0941 -0.0000 0.0941 0.1874 0.2790
Columns 55 through 63
0.3681 0.4540 0.5358 0.6129 0.6845 0.7501 0.8090 0.8607 0.9048
Columns 64 through 72
0.9409 0.9686 0.9877 0.9980 0.9995 0.9921 0.9759 0.9511 0.9178
Columns 73 through 81
0.8763 0.8271 0.7705 0.7071 0.6374 0.5621 0.4818 0.3971 0.3090
Columns 82 through 90
0.2181 0.1253 0.0314 -0.0628 -0.1564 -0.2487 -0.3387 -0.4258 -0.5090
Columns 91 through 99
-0.5878 -0.6613 -0.7290 -0.7902 -0.8443 -0.8910 -0.9298 -0.9603 -0.9823
Columns 100 through 101
-0.9956 -1.0000
>> y3=sin(6*pi*x)
y3 =
Columns 1 through 9
0 0.1874 0.3681 0.5358 0.6845 0.8090 0.9048 0.9686 0.9980
Columns 10 through 18
0.9921 0.9511 0.8763 0.7705 0.6374 0.4818 0.3090 0.1253 -0.0628
Columns 19 through 27
-0.2487 -0.4258 -0.5878 -0.7290 -0.8443 -0.9298 -0.9823 -1.0000 -0.9823
Columns 28 through 36
-0.9298 -0.8443 -0.7290 -0.5878 -0.4258 -0.2487 -0.0628 0.1253 0.3090
Columns 37 through 45
0.4818 0.6374 0.7705 0.8763 0.9511 0.9921 0.9980 0.9686 0.9048
Columns 46 through 54
0.8090 0.6845 0.5358 0.3681 0.1874 0.0000 -0.1874 -0.3681 -0.5358
Columns 55 through 63
-0.6845 -0.8090 -0.9048 -0.9686 -0.9980 -0.9921 -0.9511 -0.8763 -0.7705
Columns 64 through 72
-0.6374 -0.4818 -0.3090 -0.1253 0.0628 0.2487 0.4258 0.5878 0.7290
Columns 73 through 81
0.8443 0.9298 0.9823 1.0000 0.9823 0.9298 0.8443 0.7290 0.5878
Columns 82 through 90
0.4258 0.2487 0.0628 -0.1253 -0.3090 -0.4818 -0.6374 -0.7705 -0.8763
Columns 91 through 99
-0.9511 -0.9921 -0.9980 -0.9686 -0.9048 -0.8090 -0.6845 -0.5358 -0.3681
Columns 100 through 101
-0.1874 -0.0000
>> y4=cos(6*pi*x)
y4 =
Columns 1 through 9
1.0000 0.9823 0.9298 0.8443 0.7290 0.5878 0.4258 0.2487 0.0628
Columns 10 through 18
-0.1253 -0.3090 -0.4818 -0.6374 -0.7705 -0.8763 -0.9511 -0.9921 -0.9980
Columns 19 through 27
-0.9686 -0.9048 -0.8090 -0.6845 -0.5358 -0.3681 -0.1874 -0.0000 0.1874
Columns 28 through 36
0.3681 0.5358 0.6845 0.8090 0.9048 0.9686 0.9980 0.9921 0.9511
Columns 37 through 45
0.8763 0.7705 0.6374 0.4818 0.3090 0.1253 -0.0628 -0.2487 -0.4258
Columns 46 through 54
-0.5878 -0.7290 -0.8443 -0.9298 -0.9823 -1.0000 -0.9823 -0.9298 -0.8443
Columns 55 through 63
-0.7290 -0.5878 -0.4258 -0.2487 -0.0628 0.1253 0.3090 0.4818 0.6374
Columns 64 through 72
0.7705 0.8763 0.9511 0.9921 0.9980 0.9686 0.9048 0.8090 0.6845
Columns 73 through 81
0.5358 0.3681 0.1874 0.0000 -0.1874 -0.3681 -0.5358 -0.6845 -0.8090
Columns 82 through 90
-0.9048 -0.9686 -0.9980 -0.9921 -0.9511 -0.8763 -0.7705 -0.6374 -0.4818
Columns 91 through 99
-0.3090 -0.1253 0.0628 0.2487 0.4258 0.5878 0.7290 0.8443 0.9298
Columns 100 through 101
0.9823 1.0000
>> subplot(2,2,1)
>> plot(y1)
>> subplot(2,2,2)
>> plot(y2)
>> subplot(2,2,3)
>> plot(y3)
>> subplot(2,2,4)
>> plot(y4)
F(x)=
ezplot('(x^3)')
F(x)=
ezplot('(log(x))')
F(x)=
>> ezplot('(tan(x))')
F(x)= -1
>> ezplot('(x^3-1)')
>> diff(y)
ans =
-12*sin(x)+exp(x)+x*exp(x)
>> h=diff(y)
h=
-12*sin(x)+exp(x)+x*exp(x)
>> x=2
x=
2
>> l=-12*sin(2)+exp(2)+2*exp(2)
l=
11.2556
b)
>> syms x
>> y=2*x*sin(x)-(x^2-2)*exp(2*x)
y=
2*x*sin(x)-(x^2-2)*exp(2*x)
>> u=diff(y)
u=
2*sin(x)+2*x*cos(x)-2*x*exp(2*x)-2*(x^2-2)*exp(2*x)
>> x=2
x=
2
>> u=2*sin(2)+2*2*cos(2)-2*2*exp(2*2)-2*(2^2-2)*exp(2*2)
u=
-436.6312
c)
>> syms x
>> y=log(x)^x
y=
log(x)^x
>> g=diff(y)
g=
log(x)^x*(log(log(x))+1/log(x))
>> x=2
x=
2
>> k=log(x)^x*(log(log(x))+1/log(x))
k=
0.5171
x+2y=8; 3x-y=3
>> x= [1 2; 3 -1]
x=
1
>> y= [8; 3]
>> b=x\y
y=
b=
3 -1
b.
2x+2y-z=1 ;
x+2z=0 ;
-x-y=0
>> a= [2 2 -1; 1 0 2; -1 -1
0]
a=
b=
c=
2 -1
-2
-1
-1
-1
>> b= [1; 0; 0]
>> c=a\b
18.- La posicin de una partcula que se mueve en lnea recta esta dad por x(t)=3t-4t+ t, donde x
esta en metros y t est en segundos.
a. Calcule las expresiones para la velocidad y aceleracin instantnea (v (t) y a (t)).
La velocidad:
La aceleracin:
>>syms t
>>syms t
>>diff(3*t-4*t^2+t^3)
ans =
ans =
3*t^2 - 8*t + 3
6*t 8
La velocidad :>>ezplot(3*t^2-8*t+3)
La aceleracin :>>ezplot(6*t - 8)
>> y=prueba(4)
y = es posicin
y =es posicin
0.6250
y = es velocidad
-3.2500
y = es aceleracin
-5
12
y =es velocidad
16
y =es aceleracin
16
19.- La velocidad de una partcula que se mueve en el plano xy est dada por : v =(6t-4t)i+8j.
Aqu v est en metros por segundo y t >0 est en segundos.
a. Cul es la aceleracin cuando t =3s
por v=(6t-4t^2)i+8j.
>> syms t
>> i=6*t-4*(t^2)
i=
6*t-4*t^2
>> j=8
j=
6*t-4*t^2+8
>> l=diff(i+j)
l=
6-8*t
8
>> m=i+j
m=
6*t-4*t^2+8
>> l=diff(i+j)
l=
6-8*t
>> t=3
t=
3
>> l=diff(i+j)
l=
6-8*t
>> l=6-8*t
l=
-18
20.- Se realizo una experiencia para estudiar el movimiento de un pndulo . Los datos fueron
tomados con una interface . Para cada una de las longitudes utilizadas
(L=10cm,20cm,30cm,40cm.50cm.60cm) se almacenaron los datos en archivos denominados
datos _i.dat, donde i representa el numero de archivo . En la primera columna esta almacenando
el tiempo , en la segunda la posicin . Utilizando el comando for escriba un programa que
permita:
a. Leer los archivos. (no hay archivo)
b. Graficar la posicin en funcin del tiempo para cada longitud.
c. Calcular el periodo para cada longitud .Puede utilizar el comando ginput.
d. Graficar el periodo en funcin de la longitud del hilo
e. Teniendo en cuenta que la dependencia del periodo T con la longitud del hilo L, para
pequeas oscilaciones , est dada por :
T=
primoIII(5)
primo
primoIII(13)
primo
primoIII(8)
es primo
22. Escriba un programa que analice cada uno de los elementos de un vector y determine si es
par o impar y en qu posicin esta.
23. escriba un script que determine si un ao dado es bisiesto (nota: debe ser mltiplo de 4 y no
mltiplo de 100). El ao debe ser ingresado desde la pantalla, y el resultado mostrado en la
pantalla.
function n = input(n);
x = mod(n, 4) == 0; y = mod(n, 100) == 0; z = mod(n, 400)
== 0;
if (x & y & z) | (x & ~y & ~z)
disp('Es ao bisiesto')
else
disp('No es ao bisiesto')
end
>> n = input(2012)
Es ao bisiesto
n=
2012
>> n = input(1993)
No es ao bisiesto
n=
1993
>> n = input(2008)
Es ao bisiesto
n=
2008
>> n = input(1000)
No es ao bisiesto
n=
1000
>> n = input(1824)
Es ao bisiesto
n=
1824
25. La sucesin de Fibonacci es tal que cada elemento es la suma de los anteriores. Los
elementos inciales son 0 y 1 y a partir de ellos se pueden calcular los dems. Calcule los
elementos de la serie de Fibonacci menores que 100.
26. Escriba un programa que calcule los cuadrados de los nmeros enteros, hasta que el
cuadrado sea mayor o igual a 100.
27.-(no hay archivo)
28.-dado un numero m, calcular el cuadrado de ese nmero solo si m es mayor que 5.en caso
contrario escribe un mensaje de error
Function f=(m)^2
For m=1;m
If m>5
error
F=(m)^2
End
F=(2)
>> error
F=(6)
>>36