Professional Documents
Culture Documents
>> U+V ans = 7 >> U-V ans = -5 -5 -5 -5 -5 >> % APARTADO B >> V+3 ans = 9 10 11 12 13 >> % APARTADO C >> U.*V ans = 6 14 24 36 50 9 11 13 15
>> %APARTADO E >> U.^V ans = 1 >> 128 6561 262144 9765625
EJERCICIO 2
>> A = [1 2 1;5 4 3;7 1 0]; B = [-2 5 7;4 3 1;8 -1 3]; >> A A= 1 5 7 >> B B= -2 4 5 3 7 1 3 2 4 1 1 3 0
8 -1
>> %APARTADO A >> A+B ans = -1 9 15 >> A*B ans = 14 10 12 30 34 48 -10 38 50 >> A^4 ans = 914 2366 1164 643 1653 834 383 985 490 7 7 0 8 4 3
>> % APARTADO C >> A./B ans = -0.5000 0.4000 0.1429 1.2500 1.3333 3.0000 0.8750 -1.0000 >> 0
Matrix analysis. norm normest rank det trace null orth rref - Matrix or vector norm. - Estimate the matrix 2-norm. - Matrix rank. - Determinant. - Sum of diagonal elements. - Null space. - Orthogonalization. - Reduced row echelon form.
linsolve - Linear equation solution with extra control. inv rcond cond condest - Matrix inverse. - LAPACK reciprocal condition estimator - Condition number with respect to inversion. - 1-norm condition number estimate.
normest1 - 1-norm estimate. chol ldl lu qr - Cholesky factorization. - Block LDL' factorization. - LU factorization. - Orthogonal-triangular decomposition.
lsqnonneg - Linear least squares with nonnegativity constraints. pinv lscov - Pseudoinverse. - Least squares with known covariance.
Eigenvalues and singular values. eig svd gsvd eigs svds poly polyeig - Eigenvalues and eigenvectors. - Singular value decomposition. - Generalized singular value decomposition. - A few eigenvalues. - A few singular values. - Characteristic polynomial. - Polynomial eigenvalue problem.
ordschur - Reordering of eigenvalues in Schur decomposition. ordqz ordeig - Reordering of eigenvalues in QZ factorization. - Eigenvalues of quasitriangular matrices.
Matrix functions. expm logm sqrtm funm - Matrix exponential. - Matrix logarithm. - Matrix square root. - Evaluate general matrix function.
Factorization utilities qrdelete - Delete a column or row from QR factorization. qrinsert - Insert a column or row into QR factorization. rsf2csf cdf2rdf balance - Real block diagonal form to complex diagonal form. - Complex diagonal form to real block diagonal form. - Diagonal scaling to improve eigenvalue accuracy.
planerot - Givens plane rotation. cholupdate - rank 1 update to Cholesky factorization. qrupdate - rank 1 update to QR factorization.
Matrix analysis. norm normest rank det trace null orth rref - Matrix or vector norm. - Estimate the matrix 2-norm. - Matrix rank. - Determinant. - Sum of diagonal elements. - Null space. - Orthogonalization. - Reduced row echelon form.
linsolve - Linear equation solution with extra control. inv rcond cond condest - Matrix inverse. - LAPACK reciprocal condition estimator - Condition number with respect to inversion. - 1-norm condition number estimate.
normest1 - 1-norm estimate. chol ldl lu qr - Cholesky factorization. - Block LDL' factorization. - LU factorization. - Orthogonal-triangular decomposition.
lsqnonneg - Linear least squares with nonnegativity constraints. pinv lscov - Pseudoinverse. - Least squares with known covariance.
Eigenvalues and singular values. eig svd gsvd eigs svds poly polyeig condeig hess schur qz - Eigenvalues and eigenvectors. - Singular value decomposition. - Generalized singular value decomposition. - A few eigenvalues. - A few singular values. - Characteristic polynomial. - Polynomial eigenvalue problem. - Condition number with respect to eigenvalues. - Hessenberg form. - Schur decomposition. - QZ factorization for generalized eigenvalues.
ordschur - Reordering of eigenvalues in Schur decomposition. ordqz ordeig - Reordering of eigenvalues in QZ factorization. - Eigenvalues of quasitriangular matrices.
Matrix functions. expm logm sqrtm funm - Matrix exponential. - Matrix logarithm. - Matrix square root. - Evaluate general matrix function.
Factorization utilities qrdelete - Delete a column or row from QR factorization. qrinsert - Insert a column or row into QR factorization.
- Real block diagonal form to complex diagonal form. - Complex diagonal form to real block diagonal form. - Diagonal scaling to improve eigenvalue accuracy.
planerot - Givens plane rotation. cholupdate - rank 1 update to Cholesky factorization. qrupdate - rank 1 update to QR factorization. >> % APARTADO A >> inv(A) ans = -0.1875 0.0625 0.1250 1.3125 -0.4375 0.1250 -1.4375 0.8125 -0.3750 >> inv(B) ans = -0.0424 0.0932 0.0678 0.0169 0.2627 -0.1271 0.1186 -0.1610 0.1102 >> A*inv(A) ans = 1.0000 0.0000 0
>> % APARTADO B >> trace(B) ans = 4 >> %APARTADO C >> det(A) ans = 16.0000 >> rank(A) ans =
>>
EJERCICIO 4 >> % APARTADO A >> referencia = [100 101 102 103]; >> referencia referencia = 100 101 102 103 >> cantidad = [200 150 500 49]; >> cantidad cantidad = 200 150 500 49 >> precio = [190 345 69 598]; >> precio precio = 190 345 69 598
>>
>> % APARTADO B >> costototaldeproduccion = cantidad.* precio costototaldeproduccion = 38000 51750 34500 29302
>> % APARTADO C >> [referencia'.costototaldeproduccion'] ??? [referencia'.costototaldeproduccion'] Error: Unexpected MATLAB operator. >> [referencia',costototaldeproduccion']
ans =
>>
>>
ans = 24 >> %APARTADO B >> >> max(v) ans = 8 >> %si no se guarda la salida en dos variables solo nos devuelve el valor del maximo de los elementos >> %del vector >> >> [p,q]= max(v) p= 8 q= 3 >> [p,q]= min(v) p= -4 q= 2 >> %APARTADO C >> >> dot(u,v) ans = 26
>> % tambien se pude realizar como >> >> sum(u.*v) ans = 26 >> >> %APARTADO D >> >> norm(u),norm(v) ans = 5.3852 ans = 9.4340 >> %se podria realizar tambien >> >> sqrt(dot(u,u)) ans = 5.3852 >>
10 11 12 13 14 15 16 17 18 19 20 21
Columns 13 through 24
22 23 24 25 26 27 28 29 30 31 32 33
Columns 25 through 36
34 35 36 37 38 39 40 41 42 43 44 45
Columns 37 through 48
46 47 48 49 50 51 52 53 54 55 56 57
Columns 49 through 60
58 59 60 61 62 63 64 65 66 67 68 69
Columns 61 through 72
70 71 72 73 74 75 76 77 78 79 80 81
Columns 73 through 84
82 83 84 85 86 87 88 89 90 91 92 93
Columns 85 through 91
94 95 96 97 98 99 100
>>
0 0.2000
Columns 8 through 14
Columns 15 through 16
1.8000 2.0000
ans =
Columns 1 through 7
Columns 8 through 14
Columns 15 through 21
Columns 22 through 28
Columns 29 through 35
Columns 36 through 38
>>
>>
Columns 13 through 15
EJERCICIO 9
4 -2 6 -9 0
7 -4
4 -2 6 -9 0
7 -4
>> % se podria hacer desde el workspace >> % APARTADO C >> AA = A(2:4,1:3) AA = 1 100 -1 5 3 4 6
7 -4
2 1 -1 5
4 -2 6 -9
7 -4
>>
A=
ans =
>> A'
ans =
>> diag(A)
ans =
>> tril(A)
ans =
0.1190
0 0
0.4984 0.5853
>> % APARTADO C >> % SUMA DE LOS ELEMENTOS DE LA PRIMERA FILA >> % PRIMER CAMINO: >> A(1,1)+A(1,2)+A(1,3)
ans =
1.2107
ans =
1.2107
ans =
1.3387
ans =
1.2102
>> >>
EJERCICIO 11
A=
1 1 2 5
2 3 3 6
3 8 1 4
AA =
1 1 2 5
2 3 3 6
8 19 1 -1 4 5
ans =
b=
6 19 -1 5
>> A\b
ans =
x=
>>
A=
1 2 4 5
3 1 1 1
5 3 2 2
1 1 2 3
>> rank(A)
ans =
b=
x=
x=
>>