You are on page 1of 4

Definicin de matrices

Matlab
1 3 1
= [2 1 4] = [1 3 1; 2 1 4; 4 7 5] Matriz
4 7 5

= [2 3 7] = [2 3 7] Vector

= 1,2,3,4,5,6,7,8,9,10 = 1: 10 Vector

= 1,1.5,2,2,5,3,3.5,4,4.5,5 = 1: 0.5: 5 Vector


1 = [1 + 3 1]
1+ 3 1 2 = [2 1 + 4]
1 = [ 2 1+ 4 ] 1 = [4 7 6 + ] Matriz compleja
4 7 6+
1 = [1; 2; 3]

2,3 (2,3) Elemento de una matriz

1, (1, : ) Fila de una matriz

,3 (: ,3) Columna de una matriz

(1, : ) = [] Borrar las columnas de la fila 1

Operaciones con matrices

Matlab

=
= =transpose(A) Matriz traspuesta

= () 1 = . = ctranspose(A) Matriz traspuesta conjugada

=+ =+ Suma de matrices

= = Multiplicacin de matrices

2 = 2 2 = ^2 Matriz A al cuadrado

Multiplicacin de una matriz por


=5 =5
un escalar

= () k=trace(A) Traza de la matriz A

1 = () 1 = () Rango de una matriz

2 = () 2 = () tamao de un vector

[3, 4] = () [3, 4] = () Tamao de una matriz


Matrices especiales

Matlab
1 0 0
= [0 1 0] = (3) Matriz identidad
0 0 1

0 0 0
= [0 0 0] = (3) Matriz ceros
0 0 0

1 1 1
= [1 1 1] = (3) Matriz unos
1 1 1

0.8147 0.2785 0.9134


= [0.9058 0.6324 0.5469] = (3,3) Matriz aleatoria
0.1270 0.0975 0.9575

8 1 6
= [3 5 7] = (3) Matriz mgica
4 9 2

Determinante de una matriz

Matlab
= |A| = () Determinante de una matriz

Inversa de una matriz

Matlab
= A1 = () Inversa de una matriz

Matriz de adjuntos

Matlab
= (A1 ) |A| = () detA Matriz de adjuntos

Matriz de cofactores

Matlab
= (adjA)T = (. ) Matriz de cofactores
Graficas

plot(x,y,color_style_marker)
Color strings c cyan Line style strings - solid
m magenta -- dashed
y yelow : dotted
r red -. dash-dot
g green Omit the line style for
b blue no line
w white
k black
Marker types +, o, *, x Filled market types s square
d diamond
^ up triangle
v down triangle
> right triangle
< left triangle
p pentagrame
h hexagram
None for no marker
grid on grid off
axis on axis off
xlabel(-\pi \leq {\itt} \leq \pi) ylabel(sen(t))
title(Graf of the sine function) label(1,1/3,{\itmensaje})

axis([xmin xmax ymin ymax]) It enables you to specify your own limits
axis([xmin xmax ymin ymax zmin zmax]) It enables you to specify your own limits
axis auto Automatic limit selection
axis equal It makes the individual tick mark increments on the x-
axes and y-axes the same length
axis square x-axis and y-axis the same length

t=0:0.01:10;
y=sin(t).*cos(20*t);
grid;
plot(t,y)

clf;
hold on;
t=0:0.01:2*pi;
y1=sin(t);
y2=cos(20*t);
y=y1.*y2;
plot(t,y,'r');
plot(t,y1,':');
plot(t,-y1,':');
grid on;
title('Seal modulada','FontSize',16);
xlabel('tiempo');
ylabel('amplitud');
hold off
t1=0:pi/100:2*pi;
t2=0:pi/10:2*pi;
plot(t1,sin(t1),'b:',t2,sin(t2),'r+');

clf;
hold on;
t=0:2*pi/360:2*pi;
y1=sin(t);
y2=sin(20*t);
y=y1.*y2;
subplot(2,1,1);plot(t,y1,'r');
title('Seal moduladora','FontSize',16);
xlabel('tiempo');
ylabel('amplitud');
subplot(2,1,2);plot(t,y2,'k');
title('Seal portadora','FontSize',16);
xlabel('tiempo');
ylabel('amplitud');
grid on;
hold off

clf;
[X,Y]=meshgrid(-8:0.5:8);
R=sqrt(X.^2 + Y.^2)+eps;
Z=sin(R)./R;
mesh(X,Y,Z,'EdgeColor','Black')

clf;
t=0:pi/20:2*pi;
y=exp(sin(t));
plotyy(t,y,t,y,'plot','stem');

You might also like