Escolar Documentos
Profissional Documentos
Cultura Documentos
INGENIERIA ELÉCTRICA
SEÑALES Y SISTEMAS
HERNÁN QUINCHIMBLA
PRACTICA Nº 01
Objetivo:
Familiarizarse con el manejo del programa MATLAB.
Realización de la Práctica:
A=
16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1
>> sum(A)
ans =
34 34 34 34
>> A'
ans =
16 5 9 4
3 10 6 15
2 11 7 14
13 8 12 1
>> diag(A)
ans =
16
10
>> fliplr(A)
ans =
13 2 3 16
8 11 10 5
12 7 6 9
1 14 15 4
>> A(1,4)+A(2,4)+A(3,4)+(4,4)
>> A(1,4)+A(2,4)+A(3,4)+A(4,4)
ans =
34
>> A(4,5)
X=
16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1
>> X(4,5)=17
X=
16 3 2 13 0
5 10 11 8 0
9 6 7 12 0
4 15 14 1 17
>> 1:10
ans =
1 2 3 4 5 6 7 8 9 10
>> 100:-7:50
ans =
100 93 86 79 72 65 58 51
>> 0:pi/4:pi
ans =
>> sum(A(1:4,4))
ans =
34
>> B=magic(4)
B=
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
A=
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
A=
16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1
>> A=B(:,[4 2 3 1])
A=
13 2 3 16
8 11 10 5
12 7 6 9
1 14 15 4
>> num_estudiantes=25
num_estudiantes =
25
>> rho=(1+sqrt(5))/2
rho =
1.6180
>> a=abs(3+4i)
a=
5
>> Z=sqrt(besselk(4/3,rho-i))
Z=
0.3730 + 0.3214i
>> huge=exp(log(realmax))
huge =
1.7977e+308
>> toobig=pi*huge
toobig =
Inf
>> Z=zeros(2,4)
Z=
0 0 0 0
0 0 0 0
>> F=5*ones(3,3)
F=
5 5 5
5 5 5
5 5 5
>> N=fix(10*rand(1,10))
N=
8 9 1 9 6 0 2 5 9 9
>> R=randn(4,4)
R=
magic =
T=
16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1
>> H=magic(4)
>> H=magic(3)
>> H=magic(5)
T=
16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1
>> p=magic(4)
>> B=magic(4)
>> magic
magic =
16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1
B=
13 2 3 16 45 34 35 48
8 11 10 5 40 43 42 37
12 7 6 9 44 39 38 41
1 14 15 4 33 46 47 36
61 50 51 64 29 18 19 32
56 59 58 53 24 27 26 21
60 55 54 57 28 23 22 25
49 62 63 52 17 30 31 20
>> X(:,2)=[]
X=
16 2 13 0
5 11 8 0
9 7 12 0
4 14 1 17
A=
16 3 2 13
5 10 11 8
9 6 7 12
4 15 14 1
>> A + A'
ans =
32 8 11 17
8 20 17 23
11 17 14 26
17 23 26 2
>> A*A'
ans =
>> d = det(A)
d=
0
>> B = [ 1 2 3 4; 5 6 7 8; 1 2 4 4 ; 1 1 3 7]
B=
1 2 3 4
5 6 7 8
1 2 4 4
1 1 3 7
>> C = inv(B)
C=
-1.0000 0 1.0000 0
x=
1.3333 0.0000
>> format short
>> x
x=
1.3333 0.0000
>> x
x=
1.3333 1.2345e-006
>> x
x=
1.333333333333333 0.000001234500000
>> x
x=
1.33 0.00
>> format rat
>> x
x=
4/3 1/810045
>> x
x=
3ff5555555555555 3eb4b6231abfd271
>> A = magic(100);
numel(magic)=16.
>> A = magic(16);
>> x=0:pi/100:2*pi;
>> y = sin(x);
>> plot(x,y)
>> xlabel('x = 0:2\pi')
y = sin(x);
y2 = sin(x-.25);
y3 = sin(x-.5);
plot(x,y,x,y2,x,y3)
x1 = 0:pi/100:2*pi;
x2 = 0:pi/10:2*pi;
plot(x1,sin(x1),'r:',x2,sin(x2),'r+')
>> t = 0:pi/10:2*pi;
plot(exp(i*t),'-o')
axis equal
[x,y,z] = peaks;
pcolor(x,y,z)
shading interp
hold on
contour(x,y,z,20,'k')
hold off
t = 0:pi/10:2*pi;
[X,Y,Z] = cylinder(4*cos(t));
subplot(2,2,1); mesh(X)
subplot(2,2,2); mesh(Y)
subplot(2,2,3); mesh(Z)
subplot(2,2,4); mesh(X,Y,Z)
t = -pi:pi/100:pi;
y = sin(t);
plot(t,y)
axis([-pi pi -1 1])
r = zeros(1,32);
for n = 3:32
r(n) = rank(magic(n));
end
r
bar(r)
r=
Columns 1 through 11
0 0 3 3 5 5 7 3 9 7 11
Columns 12 through 22
3 13 9 15 3 17 11 19 3 21 13
Columns 23 through 32
23 3 25 15 27 3 29 17 31 3
function x = potdos(y);
s=
>> potdos(s)
x=
256
ans =
256