Documentos de Académico
Documentos de Profesional
Documentos de Cultura
DEBERMESHGRID
DEBERMESHGRID
PRACTICA 1
>> a=[ 12 17 3 6]
a=
12 17 3 6
b=
5 8 3
1 2 3
2 4 6
>> c=[22;17;4]
c=
22
17
4
>> %Asigne a la variable x1 el valor en la segunda columna de la matriz A. En
X1=a1.2
>> x1=a(:,2)
x1 =
17
x2 =
3
3
6
>> x2=b(:,3)
x2 =
3
3
6
>> x2=b(3:,)
x2=b(3:,)
↑
Error: Expression or statement is incorrect--possibly
unbalanced (, {, or [.
>> x2=b(3,:)
x2 =
2 4 6
>> x2=b(:,3)
x2 =
3
3
6
>> x3=b(3,:)
x3 =
2 4 6
>> x4=diag(b)
x4 =
5
2
6
>> clear
>> cc
Undefined function or variable 'cc'.
>> a=[ 12 17 3 6]
a=
12 17 3 6
c=
22
17
4
x1 =
17
3
3
6
x3 =
2 4 6
x4 =
5
2
6
>> x5=[a(:,1:3);b]
x5 =
12 17 3
5 8 3
1 2 3
2 4 6
>> x6=[c(1:3,:),b(:,1:3)]
x6 =
22 5 8 3
17 1 2 3
4 2 4 6
>> x7=b(8)
x7 =
>> x8=b(:)
x8 =
5
1
2
8
2
4
3
3
6
TAREA 2
long =
1 3 5
>> anch=[2,4,6,8]
anch =
2 4 6 8
>> [nlong,nanch]=meshgrid(long,anch)
nlong =
1 3 5
1 3 5
1 3 5
1 3 5
nanch =
2 2 2
4 4 4
6 6 6
8 8 8
>> area=[nlong.*nanch]
area =
2 6 10
4 12 20
6 18 30
8 24 40
radios =
1 2 3 4 5 6 7 8 9 10 11 12
>> radios=[1:3:12]
radios =
1 4 7 10
>> radios=[0:3:12]
radios =
0 3 6 9 12
>> alturas=[10:2:20]
alturas =
10 12 14 16 18 20
>> [nradios,nalturas]=meshgrid(radios,alturas)
nradios =
0 3 6 9 12
0 3 6 9 12
0 3 6 9 12
0 3 6 9 12
0 3 6 9 12
0 3 6 9 12
nalturas =
10 10 10 10 10
12 12 12 12 12
14 14 14 14 14
16 16 16 16 16
18 18 18 18 18
20 20 20 20 20
>> volumen=pi*(nradios.^2.*nalturas)
volumen =
1.0e+03 *