Vous êtes sur la page 1sur 14

TRABAJO DE ALGEBRA LINEAL

JORGE RAMIRO ALEGRIA VELASCO ING. ELIZABETH ASIMBAYA ESPE-ETE D

APLICACIONES DE ALGEBRA LINEAL EN MATLAB

ASIGNATURA-PROGRAMACION
Existen asignaturas, en las cuales podemos aplicar programacin a estas. Hay muchos problemas, ejercicios, que si los programamos, se nos hace mas fcil calcularlos, porque se vuelven algoritmos.

En estas asignaturas podemos recalcar, la que necesitamos este momento, hablamos de ALGEBRA LINEAL, para esta asignatura, existen muchos lenguajes de programacin, para aplicarla a dicha asignatura. Para esta presentacin necesitamos hablar mas del lenguaje que utiliza MATLAB, es sencillo, y apto para el calculo de valores.

En matlab, calculen:

podemos

realizar

programas

que

Valores de determinantes Multiplicacin y suma de matrices Obtencin de matriz conjugada Obtencin de matriz inversa Traza de una matriz Obtencin de una matriz asociada Diagonalizar una matriz Sistemas de ecuaciones lineales Producto interno Calculo de angulo entre vectores Etc.

CALCULO DEL DETERMINANTE DE UNA


MATRIZ

Existen programas como:

%calculo del determinante de una matriz clc fprintf ('\t \t \t BIENVENIDO A MI PROGRAMA[jrav] \n \n') fprintf ('\n DETERMINANTE DE UNA MATRIZ \n \n') filcol=input (' Ingrese el numero de filas y columnas:'); %Ingreso de elementos for f=1:filcol for c=1:filcol fprintf (' Ingrese el elemento (%d, %d)', f, c) A(f, c)=input (' :'); end end A DetA=det(A);

fprintf (' el determiante de la matriz es %d', DetA) fprintf ('\n \n \t \t \t \t Jorge Ramiro Alegria Velasco') fprintf ('\n \n \t \t \t \t \t ...gracias por utilizar mi programa!!\n \n')

EL PROGRAMA CON UN EJEMPLO, SE VERA ASI:

CALCULO DE LA NORMA DE UN
VECTOR

Asi tambien este programa:

%calculo de norma de un vector clc fprintf ('\t \t \t BIENVENIDO A MI PROGRAMA[jrav]\n'); fprintf ('\n NORMA DE UN VECTOR \n \n'); col=input (' Ingrese la dimension del vector: '); fprintf ('\n \n Ingrese el vector u: \n') %Ingreso de elementos for f=1:col for c=1:col fprintf (' Ingrese el elemento %d',c); u(1, c)=input (' :'); end %end fprintf(' El vector u, es: \n') u end fprintf (' \n \n La norma del vector u, es: \n') NORMA= sqrt(u*u') fprintf ('\n \n \t \t \t \t Jorge Ramiro Alegria Velasco') fprintf ('\n \n \t \t \t \t \t ...gracias por utilizar mi programa!!\n \n')

EL PROGRAMA CON UN EJEMPLO, SE VERA ASI:

CALCULO

DEL PRODUCTO INTERNO

Asi tambien este programa:

%calculo de producto interno clc fprintf ('\t \t \t BIENVENIDO A MI PROGRAMA[jrav]\n'); fprintf ('\n PRODUCTO INTERNO \n \n'); col=input (' Ingrese la dimension de los vectores: '); fprintf ('\n Ingrese el vector u: \n') %for f=1:col for c=1:col fprintf ('Ingrese el elemento %d', c) u(1, c)=input (' :'); end fprintf ('\n El vector u es:\n') u fprintf ('\n Ingrese el vector v: \n') %for f=1:col for c=1:col fprintf ('Ingrese el elemento %d', c) v(1, c)=input (' :'); end fprintf ('\n El vector v es:\n') v fprintf ('\n El producto interno es:\n') p=u*v' fprintf ('\n \n \t \t \t \t Jorge Ramiro Alegria Velasco')

fprintf ('\n \n \t \t \t \t \t ...gracias por utilizar mi programa!!\n \n')

EL PROGRAMA CON UN EJEMPLO, SE VERA ASI:

CALCULO DE UN

ANGULO ENTRE

VECTORES
Asi tambien este programa:
%calculo angulo entre vectores clc fprintf ('\t \t \t BIENVENIDO A MI PROGRAMA[jrav]\n'); fprintf ('\n ANGULO ENTRE VECTORES \n \n'); col=input (' Ingrese la dimension de los vectores: '); fprintf ('\n Ingrese el vector u: \n') %for f=1:col for c=1:col fprintf ('Ingrese el elemento %d', c) u(1, c)=input (' :'); end fprintf ('\n El vector u es:\n') u fprintf ('\n Ingrese el vector v: \n') %for f=1:col for c=1:col fprintf ('Ingrese el elemento %d', c) v(1, c)=input (' :'); end fprintf ('\n El vector v es:\n') v p=u*v'; NORMA1=sqrt(u*u'); NORMA2=sqrt(v*v'); d=(acos(p/(NORMA1*NORMA2)))*180/pi; fprintf ('\n El angulo entre vectores es: %.5f', d) if (p>0) fprintf ('\n\n Por lo tanto, "el angulo es agudo" \n') end if (p<0) fprintf ('\n\n Por lo tanto, "el angulo es obtuso" \n') end if (p==0) fprintf ('\n\n Por lo tanto, "los vectores son ortogonales" \n') end fprintf ('\n \n \t \t \t \t Jorge Ramiro Alegria Velasco') fprintf ('\n \n \t \t \t \t \t ...gracias por utilizar mi programa!!\n \n')

EL PROGRAMA CON UN EJEMPLO, SE VERA ASI:

FIN DE LA PRESENTACION
NOTA.- TODOS LOS CODIGOS PUESTOS EN LA PRESENTACION, CORREN EN MATLAB, DE HECHO, AHI SE AH PUESTO COMO SE VE EL PROGRAMA EN MATLAB!!

Vous aimerez peut-être aussi