You are on page 1of 28

MATLAB Command Window Page 1

>> A= 1:10;
>> B= [78.115 46.07 102.3];
>> masa(A,B)
Unrecognized function or variable 'NW1'.

Error in masa (line 3)


m=(n1.*NW1)';

>> masa(A,B)

ans =

1.0e+03 *

0.0781 0.0461 0.1023


0.1562 0.0921 0.2046
0.2343 0.1382 0.3069
0.3125 0.1843 0.4092
0.3906 0.2303 0.5115
0.4687 0.2764 0.6138
0.5468 0.3225 0.7161
0.6249 0.3686 0.8184
0.7030 0.4146 0.9207
0.7812 0.4607 1.0230

>> %Literal A
>> examen1_ejer1
Not enough input arguments.

Error in examen1_ejer1 (line 2)


[n1,NW1]=meshgrid(n,NW);

>> examen1_ejer1(A,B)

ans =

0.0128 0.0217 0.0098


0.0256 0.0434 0.0196
0.0384 0.0651 0.0293
0.0512 0.0868 0.0391
0.0640 0.1085 0.0489
0.0768 0.1302 0.0587
0.0896 0.1519 0.0684
0.1024 0.1736 0.0782
0.1152 0.1954 0.0880
0.1280 0.2171 0.0978

>> %Examen 2 literal a


>> examen1_ejer2_a
Tabla de yen a dolares
yen, doll
5 0.03
10 0.07
15 0.10
20 0.14
MATLAB Command Window Page 2

25 0.17
30 0.21
35 0.24
40 0.28
45 0.31
50 0.34
55 0.38
60 0.41
65 0.45
70 0.48
75 0.52
80 0.55
85 0.59
90 0.62
95 0.66
100 0.69
105 0.72
110 0.76
115 0.79
120 0.83
125 0.86
>> examen1_ejer2_b
Tabla de euros a dolares
eur, doll
1 1.08
3 3.24
5 5.40
7 7.56
9 9.72
11 11.88
13 14.04
15 16.20
17 18.36
19 20.52
21 22.68
23 24.84
25 27.00
27 29.16
29 31.32
31 33.48
33 35.64
35 37.80
37 39.96
39 42.12
41 44.28
43 46.44
45 48.60
47 50.76
49 52.92
51 55.08
53 57.24
55 59.40
57 61.56
59 63.72
>> examen1_ejer2_c
MATLAB Command Window Page 3

Tabla de dolares a euros a libras y a yenes


doll, eur, lib, yen
1 0.93 0.80 145.50
2 1.85 1.60 291.00
3 2.78 2.40 436.50
4 3.70 3.20 582.00
5 4.63 4.00 727.50
6 5.56 4.80 873.00
7 6.48 5.60 1018.50
8 7.41 6.40 1164.00
9 8.33 7.20 1309.50
10 9.26 8.00 1455.00
>> %examen 2 ejercicio 1
>> A=0:1.9;
>> B=7926/2

B =

3963

>> examen2_ejer2
Not enough input arguments.

Error in examen2_ejer2 (line 2)


[r1,h1]=meshgrid(r,h);

>> A=0:1.9;
>> B=7926/2

B =

3963

>> examen2_ejer2=(B,A)
examen2_ejer2=(B,A)

Invalid expression. When calling a function or indexing a variable, use parentheses.


Otherwise, check for mismatched
delimiters.

>> examen2_ejer2=(A,B)
examen2_ejer2=(A,B)

Invalid expression. When calling a function or indexing a variable, use parentheses.


Otherwise, check for mismatched
delimiters.

>> A=linspace(0,1.9);
>> B=7926/2

B =

3963

>> examen2_ejer2=(B,A)
MATLAB Command Window Page 4

examen2_ejer2=(B,A)

Invalid expression. When calling a function or indexing a variable, use parentheses.


Otherwise, check for mismatched
delimiters.

>> examen2_ejer2(B,A)

d =

0
12.3335
17.4422
21.3623
24.6671
27.5787
30.2110
32.6316
34.8847
37.0009
39.0024
40.9061
42.7251
44.4698
46.1485
47.7683
49.3349
50.8534
52.3277
53.7617
55.1584
56.5206
57.8508
59.1510
60.4233
61.6694
62.8907
64.0888
65.2649
66.4202
67.5558
68.6726
69.7715
70.8534
71.9190
72.9690
74.0042
75.0251
76.0323
77.0263
78.0077
78.9768
79.9343
80.8804
81.8155
MATLAB Command Window Page 5

82.7401
83.6545
84.5590
85.4539
86.3396
87.2163
88.0842
88.9437
89.7950
90.6382
91.4738
92.3017
93.1223
93.9357
94.7422
95.5418
96.3348
97.1213
97.9016
98.6756
99.4437
100.2058
100.9622
101.7130
102.4583
103.1982
103.9328
104.6623
105.3868
106.1063
106.8209
107.5308
108.2361
108.9368
109.6330
110.3248
111.0124
111.6957
112.3748
113.0499
113.7209
114.3881
115.0513
115.7108
116.3665
117.0186
117.6670
118.3119
118.9533
119.5913
120.2259
120.8571
121.4851
122.1099
122.7315
MATLAB Command Window Page 6

ans =

0
12.3335
17.4422
21.3623
24.6671
27.5787
30.2110
32.6316
34.8847
37.0009
39.0024
40.9061
42.7251
44.4698
46.1485
47.7683
49.3349
50.8534
52.3277
53.7617
55.1584
56.5206
57.8508
59.1510
60.4233
61.6694
62.8907
64.0888
65.2649
66.4202
67.5558
68.6726
69.7715
70.8534
71.9190
72.9690
74.0042
75.0251
76.0323
77.0263
78.0077
78.9768
79.9343
80.8804
81.8155
82.7401
83.6545
84.5590
85.4539
86.3396
87.2163
MATLAB Command Window Page 7

88.0842
88.9437
89.7950
90.6382
91.4738
92.3017
93.1223
93.9357
94.7422
95.5418
96.3348
97.1213
97.9016
98.6756
99.4437
100.2058
100.9622
101.7130
102.4583
103.1982
103.9328
104.6623
105.3868
106.1063
106.8209
107.5308
108.2361
108.9368
109.6330
110.3248
111.0124
111.6957
112.3748
113.0499
113.7209
114.3881
115.0513
115.7108
116.3665
117.0186
117.6670
118.3119
118.9533
119.5913
120.2259
120.8571
121.4851
122.1099
122.7315

>> A=linspace(0,1.9);
>> C=4217/2

C =
MATLAB Command Window Page 8

2.1085e+03

>> examen2_ejer2(C,A)

d =

0
8.9963
12.7227
15.5821
17.9926
20.1164
22.0365
23.8022
25.4457
26.9893
28.4493
29.8379
31.1647
32.4374
33.6619
34.8435
35.9863
37.0939
38.1694
39.2154
40.2342
41.2279
42.1982
43.1467
44.0748
44.9838
45.8747
46.7487
47.6067
48.4494
49.2778
50.0925
50.8941
51.6833
52.4607
53.2267
53.9819
54.7266
55.4613
56.1865
56.9024
57.6094
58.3079
58.9981
59.6803
60.3548
61.0219
61.6817
62.3346
MATLAB Command Window Page 9

62.9807
63.6203
64.2535
64.8805
65.5015
66.1167
66.7262
67.3303
67.9289
68.5224
69.1107
69.6941
70.2726
70.8465
71.4157
71.9804
72.5407
73.0968
73.6486
74.1964
74.7401
75.2799
75.8159
76.3481
76.8767
77.4016
77.9230
78.4410
78.9555
79.4667
79.9747
80.4795
80.9811
81.4796
81.9751
82.4677
82.9573
83.4440
83.9279
84.4091
84.8875
85.3633
85.8364
86.3070
86.7749
87.2404
87.7034
88.1640
88.6222
89.0781
89.5316

ans =
MATLAB Command Window Page 10

0
8.9963
12.7227
15.5821
17.9926
20.1164
22.0365
23.8022
25.4457
26.9893
28.4493
29.8379
31.1647
32.4374
33.6619
34.8435
35.9863
37.0939
38.1694
39.2154
40.2342
41.2279
42.1982
43.1467
44.0748
44.9838
45.8747
46.7487
47.6067
48.4494
49.2778
50.0925
50.8941
51.6833
52.4607
53.2267
53.9819
54.7266
55.4613
56.1865
56.9024
57.6094
58.3079
58.9981
59.6803
60.3548
61.0219
61.6817
62.3346
62.9807
63.6203
64.2535
64.8805
65.5015
66.1167
MATLAB Command Window Page 11

66.7262
67.3303
67.9289
68.5224
69.1107
69.6941
70.2726
70.8465
71.4157
71.9804
72.5407
73.0968
73.6486
74.1964
74.7401
75.2799
75.8159
76.3481
76.8767
77.4016
77.9230
78.4410
78.9555
79.4667
79.9747
80.4795
80.9811
81.4796
81.9751
82.4677
82.9573
83.4440
83.9279
84.4091
84.8875
85.3633
85.8364
86.3070
86.7749
87.2404
87.7034
88.1640
88.6222
89.0781
89.5316

>> A=linspace(0,1.9);
>> B=7926/2

B =

3963

>> a=examen2_ejer2(B,A)
MATLAB Command Window Page 12

a =

0
12.3335
17.4422
21.3623
24.6671
27.5787
30.2110
32.6316
34.8847
37.0009
39.0024
40.9061
42.7251
44.4698
46.1485
47.7683
49.3349
50.8534
52.3277
53.7617
55.1584
56.5206
57.8508
59.1510
60.4233
61.6694
62.8907
64.0888
65.2649
66.4202
67.5558
68.6726
69.7715
70.8534
71.9190
72.9690
74.0042
75.0251
76.0323
77.0263
78.0077
78.9768
79.9343
80.8804
81.8155
82.7401
83.6545
84.5590
85.4539
86.3396
87.2163
88.0842
88.9437
MATLAB Command Window Page 13

89.7950
90.6382
91.4738
92.3017
93.1223
93.9357
94.7422
95.5418
96.3348
97.1213
97.9016
98.6756
99.4437
100.2058
100.9622
101.7130
102.4583
103.1982
103.9328
104.6623
105.3868
106.1063
106.8209
107.5308
108.2361
108.9368
109.6330
110.3248
111.0124
111.6957
112.3748
113.0499
113.7209
114.3881
115.0513
115.7108
116.3665
117.0186
117.6670
118.3119
118.9533
119.5913
120.2259
120.8571
121.4851
122.1099
122.7315

>> C=4217/2

C =

2.1085e+03

>> b=examen2_ejer2(C,A)
MATLAB Command Window Page 14

b =

0
8.9963
12.7227
15.5821
17.9926
20.1164
22.0365
23.8022
25.4457
26.9893
28.4493
29.8379
31.1647
32.4374
33.6619
34.8435
35.9863
37.0939
38.1694
39.2154
40.2342
41.2279
42.1982
43.1467
44.0748
44.9838
45.8747
46.7487
47.6067
48.4494
49.2778
50.0925
50.8941
51.6833
52.4607
53.2267
53.9819
54.7266
55.4613
56.1865
56.9024
57.6094
58.3079
58.9981
59.6803
60.3548
61.0219
61.6817
62.3346
62.9807
63.6203
64.2535
MATLAB Command Window Page 15

64.8805
65.5015
66.1167
66.7262
67.3303
67.9289
68.5224
69.1107
69.6941
70.2726
70.8465
71.4157
71.9804
72.5407
73.0968
73.6486
74.1964
74.7401
75.2799
75.8159
76.3481
76.8767
77.4016
77.9230
78.4410
78.9555
79.4667
79.9747
80.4795
80.9811
81.4796
81.9751
82.4677
82.9573
83.4440
83.9279
84.4091
84.8875
85.3633
85.8364
86.3070
86.7749
87.2404
87.7034
88.1640
88.6222
89.0781
89.5316

>> abla=table(T',K','VariableNames',{'Temperatura','K'})
Unrecognized function or variable 'T'.

>> Tabla=table(a',b','VariableNames',{'Tierra','Marte'})
Unable to use a value of type cell as an index.
MATLAB Command Window Page 16

table appears to be both a function and a variable. If this is unintentional, use


'clear table' to remove the variable
'table' from the workspace.

>> Tabla=table(a,b,'VariableNames',{'Tierra','Marte'})
Unable to use a value of type cell as an index.

table appears to be both a function and a variable. If this is unintentional, use


'clear table' to remove the variable
'table' from the workspace.

>> a=examen2_ejer2(B,A)

a =

0
12.3335
17.4422
21.3623
24.6671
27.5787
30.2110
32.6316
34.8847
37.0009
39.0024
40.9061
42.7251
44.4698
46.1485
47.7683
49.3349
50.8534
52.3277
53.7617
55.1584
56.5206
57.8508
59.1510
60.4233
61.6694
62.8907
64.0888
65.2649
66.4202
67.5558
68.6726
69.7715
70.8534
71.9190
72.9690
74.0042
75.0251
76.0323
77.0263
MATLAB Command Window Page 17

78.0077
78.9768
79.9343
80.8804
81.8155
82.7401
83.6545
84.5590
85.4539
86.3396
87.2163
88.0842
88.9437
89.7950
90.6382
91.4738
92.3017
93.1223
93.9357
94.7422
95.5418
96.3348
97.1213
97.9016
98.6756
99.4437
100.2058
100.9622
101.7130
102.4583
103.1982
103.9328
104.6623
105.3868
106.1063
106.8209
107.5308
108.2361
108.9368
109.6330
110.3248
111.0124
111.6957
112.3748
113.0499
113.7209
114.3881
115.0513
115.7108
116.3665
117.0186
117.6670
118.3119
118.9533
119.5913
MATLAB Command Window Page 18

120.2259
120.8571
121.4851
122.1099
122.7315

>> b=examen2_ejer2(C,A)

b =

0
8.9963
12.7227
15.5821
17.9926
20.1164
22.0365
23.8022
25.4457
26.9893
28.4493
29.8379
31.1647
32.4374
33.6619
34.8435
35.9863
37.0939
38.1694
39.2154
40.2342
41.2279
42.1982
43.1467
44.0748
44.9838
45.8747
46.7487
47.6067
48.4494
49.2778
50.0925
50.8941
51.6833
52.4607
53.2267
53.9819
54.7266
55.4613
56.1865
56.9024
57.6094
58.3079
58.9981
59.6803
MATLAB Command Window Page 19

60.3548
61.0219
61.6817
62.3346
62.9807
63.6203
64.2535
64.8805
65.5015
66.1167
66.7262
67.3303
67.9289
68.5224
69.1107
69.6941
70.2726
70.8465
71.4157
71.9804
72.5407
73.0968
73.6486
74.1964
74.7401
75.2799
75.8159
76.3481
76.8767
77.4016
77.9230
78.4410
78.9555
79.4667
79.9747
80.4795
80.9811
81.4796
81.9751
82.4677
82.9573
83.4440
83.9279
84.4091
84.8875
85.3633
85.8364
86.3070
86.7749
87.2404
87.7034
88.1640
88.6222
89.0781
89.5316
MATLAB Command Window Page 20

>> Tabla=table(a,b,'VariableNames',{'Tierra','Marte'})
Unable to use a value of type cell as an index.

table appears to be both a function and a variable. If this is unintentional, use


'clear table' to remove the variable
'table' from the workspace.

>> tabla=table(a,b,'VariableNames',{'Tierra','Marte'})
Unable to use a value of type cell as an index.

table appears to be both a function and a variable. If this is unintentional, use


'clear table' to remove the variable
'table' from the workspace.

>> a=examen2_ejer2(B,A)

a =

0
12.3335
17.4422
21.3623
24.6671
27.5787
30.2110
32.6316
34.8847
37.0009
39.0024
40.9061
42.7251
44.4698
46.1485
47.7683
49.3349
50.8534
52.3277
53.7617
55.1584
56.5206
57.8508
59.1510
60.4233
61.6694
62.8907
64.0888
65.2649
66.4202
67.5558
68.6726
69.7715
70.8534
71.9190
72.9690
MATLAB Command Window Page 21

74.0042
75.0251
76.0323
77.0263
78.0077
78.9768
79.9343
80.8804
81.8155
82.7401
83.6545
84.5590
85.4539
86.3396
87.2163
88.0842
88.9437
89.7950
90.6382
91.4738
92.3017
93.1223
93.9357
94.7422
95.5418
96.3348
97.1213
97.9016
98.6756
99.4437
100.2058
100.9622
101.7130
102.4583
103.1982
103.9328
104.6623
105.3868
106.1063
106.8209
107.5308
108.2361
108.9368
109.6330
110.3248
111.0124
111.6957
112.3748
113.0499
113.7209
114.3881
115.0513
115.7108
116.3665
117.0186
MATLAB Command Window Page 22

117.6670
118.3119
118.9533
119.5913
120.2259
120.8571
121.4851
122.1099
122.7315

>> e=examen2_ejer2(B,A)

e =

0
12.3335
17.4422
21.3623
24.6671
27.5787
30.2110
32.6316
34.8847
37.0009
39.0024
40.9061
42.7251
44.4698
46.1485
47.7683
49.3349
50.8534
52.3277
53.7617
55.1584
56.5206
57.8508
59.1510
60.4233
61.6694
62.8907
64.0888
65.2649
66.4202
67.5558
68.6726
69.7715
70.8534
71.9190
72.9690
74.0042
75.0251
76.0323
77.0263
78.0077
MATLAB Command Window Page 23

78.9768
79.9343
80.8804
81.8155
82.7401
83.6545
84.5590
85.4539
86.3396
87.2163
88.0842
88.9437
89.7950
90.6382
91.4738
92.3017
93.1223
93.9357
94.7422
95.5418
96.3348
97.1213
97.9016
98.6756
99.4437
100.2058
100.9622
101.7130
102.4583
103.1982
103.9328
104.6623
105.3868
106.1063
106.8209
107.5308
108.2361
108.9368
109.6330
110.3248
111.0124
111.6957
112.3748
113.0499
113.7209
114.3881
115.0513
115.7108
116.3665
117.0186
117.6670
118.3119
118.9533
119.5913
120.2259
MATLAB Command Window Page 24

120.8571
121.4851
122.1099
122.7315

>> i=examen2_ejer2(C,A)

i =

0
8.9963
12.7227
15.5821
17.9926
20.1164
22.0365
23.8022
25.4457
26.9893
28.4493
29.8379
31.1647
32.4374
33.6619
34.8435
35.9863
37.0939
38.1694
39.2154
40.2342
41.2279
42.1982
43.1467
44.0748
44.9838
45.8747
46.7487
47.6067
48.4494
49.2778
50.0925
50.8941
51.6833
52.4607
53.2267
53.9819
54.7266
55.4613
56.1865
56.9024
57.6094
58.3079
58.9981
59.6803
60.3548
MATLAB Command Window Page 25

61.0219
61.6817
62.3346
62.9807
63.6203
64.2535
64.8805
65.5015
66.1167
66.7262
67.3303
67.9289
68.5224
69.1107
69.6941
70.2726
70.8465
71.4157
71.9804
72.5407
73.0968
73.6486
74.1964
74.7401
75.2799
75.8159
76.3481
76.8767
77.4016
77.9230
78.4410
78.9555
79.4667
79.9747
80.4795
80.9811
81.4796
81.9751
82.4677
82.9573
83.4440
83.9279
84.4091
84.8875
85.3633
85.8364
86.3070
86.7749
87.2404
87.7034
88.1640
88.6222
89.0781
89.5316
MATLAB Command Window Page 26

>> tabla=table(e,1,'VariableNames',{'Tierra','Marte'})
Unable to use a value of type cell as an index.

table appears to be both a function and a variable. If this is unintentional, use


'clear table' to remove the variable
'table' from the workspace.

>> tabla=table(e',1','VariableNames',{'Tierra','Marte'})
Unable to use a value of type cell as an index.

table appears to be both a function and a variable. If this is unintentional, use


'clear table' to remove the variable
'table' from the workspace.

>> clear table


>> tabla=table(e,i,'VariableNames',{'Tierra','Marte'})

tabla =

100×2 table

Tierra Marte
______ ______

0 0
12.334 8.9963
17.442 12.723
21.362 15.582
24.667 17.993

: :

120.23 87.703
120.86 88.164
121.49 88.622
122.11 89.078
122.73 89.532

Display all 100 rows.

tabla =

100×2 table

Tierra Marte
______ ______

0 0
12.334 8.9963
17.442 12.723
21.362 15.582
24.667 17.993
27.579 20.116
30.211 22.036
MATLAB Command Window Page 27

32.632 23.802
34.885 25.446
37.001 26.989
39.002 28.449
40.906 29.838
42.725 31.165
44.47 32.437
46.149 33.662
47.768 34.843
49.335 35.986
50.853 37.094
52.328 38.169
53.762 39.215
55.158 40.234
56.521 41.228
57.851 42.198
59.151 43.147
60.423 44.075
61.669 44.984
62.891 45.875
64.089 46.749
65.265 47.607
66.42 48.449
67.556 49.278
68.673 50.092
69.771 50.894
70.853 51.683
71.919 52.461
72.969 53.227
74.004 53.982
75.025 54.727
76.032 55.461
77.026 56.186
78.008 56.902
78.977 57.609
79.934 58.308
80.88 58.998
81.816 59.68
82.74 60.355
83.655 61.022
84.559 61.682
85.454 62.335
86.34 62.981
87.216 63.62
88.084 64.253
88.944 64.88
89.795 65.502
90.638 66.117
91.474 66.726
92.302 67.33
93.122 67.929
93.936 68.522
94.742 69.111
95.542 69.694
96.335 70.273
MATLAB Command Window Page 28

97.121 70.846
97.902 71.416
98.676 71.98
99.444 72.541
100.21 73.097
100.96 73.649
101.71 74.196
102.46 74.74
103.2 75.28
103.93 75.816
104.66 76.348
105.39 76.877
106.11 77.402
106.82 77.923
107.53 78.441
108.24 78.956
108.94 79.467
109.63 79.975
110.32 80.479
111.01 80.981
111.7 81.48
112.37 81.975
113.05 82.468
113.72 82.957
114.39 83.444
115.05 83.928
115.71 84.409
116.37 84.888
117.02 85.363
117.67 85.836
118.31 86.307
118.95 86.775
119.59 87.24
120.23 87.703
120.86 88.164
121.49 88.622
122.11 89.078
122.73 89.532

>> pulgadas_a_angstroms
tabla de pulgadas a angstroms
pulgadas/inchs, angstroms/Å
1 2.54e+08
2 5.08e+08
3 7.62e+08
4 1.02e+09
5 1.27e+09
6 1.52e+09
7 1.78e+09
8 2.03e+09
9 2.29e+09
10 2.54e+09
>>

You might also like