Está en la página 1de 7

DESARROLLO DE PROBLEMAS (2 PRCTICA)

PREGUNTA 4.1

22

a)

>> a=[15 3 22;3 8 5;14 3 82];

82

>> b=[1; 5 ;6];


>> c=[12 18 5 2];

d)

>> d=a(:,3)

>> x=c(:,1:3)

d=

x=

22

12

18

>> g=[a ; x]

82

g=

b)

15

22

>> e=[b d]

e=

14

82

12

18

22

82

e)

c)

>> h=[a(1,3) c(1,2) b(2,1)]

>> f=[b; d]

h=

f=

22
1
5
6

18

PREGUNTA 4.2

17

72

65

89

>> thermo_scores=[1 68 45 92; 2 83


54 93; 3 61 67 91; 4 70 66 92; 5 75 68
96; 6 82 67 90;7 57 65 89; 8 5 69 89;
9 76 62 97; 10 85 52 94; 11 62 34 87;
12 71 45 85; 13 96 56 45; 14 78 65
87; 15 76 43 97; 16 68 76 95; 17 72
65 89; 18 75 67 88; 19 83 68 91; 20
93 90 92]

18

75

67

88

19

83

68

91

20

93

90

92

a)
>> student_5=thermo_scores(5,:)

thermo_scores =
1

68

45

92

83

54

93

61

67

91

70

66

92

75

68

96

82

67

90

57

65

89

69

89

76

62

97

10

85

52

94

11

62

34

87

12

71

45

85

13

96

56

45

14

78

65

87

15

76

43

97

16

68

76

95

student_5 =

75

68

96

b)
>> test_1=thermo_scores(:,2)
test_1 =
68
83
61
70
75
82
57
5
76

0 2.5000
10.0000

85
62

5.0000

7.5000

71
>> area=(a.*b)/2

96
78

area =

76
68

0 3.7500 10.0000 18.7500


30.0000

72
75
83
93

PREGUNTA 4.5
>> a=[2:6]

a=

>> b=0:2.5:10

b=

PREGUNTA 5.1
>> x=[0:10]

Columns 1 through 8

x=
0
8

1 2
9 10

0 0.8415 0.9093 0.1411 0.7568 -0.9589 -0.2794 0.6570

>> % PREGUNTA 5.1 (A)


>> y=exp(x)

Columns 9 through 11

y=

0.9894

0.4121 -0.5440

1.0e+004 *
0.0001 0.0003 0.0007 0.0020
0.0055 0.0148 0.0403 0.1097
0.2981

0.8103

>> plot(x,y)

2.2026

c)
>> a=5
b)
>> y=sin(x)

y=

a=

c)
>> a=5;

Columns 1 through 8

>> b=2;
>> c=4;
>> y=a*x.^2+b*x+c

y=

4 11 28 55 92 139 196
263 340 427 524

0
2.0000

1.0000
2.2361

1.4142
2.4495

Columns 9 through 11

2.8284

3.0000

>> plot(x,y)
>> plot(x,y)

> plot(x,y)

PREGUNTA 5.3

d)

>> x=[-pi:pi/10:pi];

>> y= sqrt(x)

>> y1=sin(x);
>> y2=sin(2*x);

y=

>> y3=sin(3*x);

3.1623

1.7321
2.6458

>> subplot(2,2,1)
>> plot(x,y1)
>> subplot(2,2,2)
>> plot(x,y2)
>> subplot(2,2,3)
>> plot(x,y3)

PREGUNTA 5.5
>> subplot(2,2,1)
>> plot(x,y1)
>> legend('funcion seno')
>> axis([-4 4 -4 4])
>> text(0,2,'sen(x)')
PREGUNTA 5.4
>> x=[-pi:pi/10:pi];
>> y1=sin(x);
>> y2=sin(2*x);
>> y3=sin(3*x);
>> subplot(2,2,1)
>> plot(x,y1,'--r')
>> subplot(2,2,2)
>> plot(x,y2,'-b')
>> subplot(2,2,3)
>> plot(x,y3,':g')

>> subplot(2,2,2)
>> plot(x,y2)
>> legend('funcion seno')
>> axis([-4 4 -4 4])
>> text(0,2,'sen(2x)')
>> subplot(2,2,3)
>> plot(x,y3)
>> legend('funcion seno')
>> axis([-4 4 -4 4])
>> text(0,2,'sen(3x)')

PREGUNTA 5.6

b)

a)

>> plot(t,v)

>> Vo=100;

>> xlabel('tiempo')

>> ang=pi/4;

>> ylabel('altura')

>> g=10;

>> title('movimiento vertical')

>> t=[0:1:20];
>> h=t*Vo*cos(ang);
>> v=t*Vo*sin(ang)-g*t.^2/2;
>> plot(h,t)
>> xlabel('distancia')
>> ylabel('tiempo')
>> title('movimiento horizontal')