viernes, 15 de agosto de 2008

APLICACIONES EN MACROS Y MATLAB

MACRO

Con PowerPoint 97 se pueden crear macros para automatizar tareas que se realizan repetidamente. Una macro consta básicamente de una lista de comandos para que los lleve a cabo PowerPoint. Un método para crear una macro es grabar los comandos utilizando la grabadora de macros integrada de PowerPoint. Este artículo preliminar incluye los pasos necesarios para grabar, ejecutar y eliminar macros. También contiene información acerca de dónde se almacenan las macros y algunas limitaciones de las macros creadas con la grabadora de macros.
Ejemplo:
Sub Macro1()
'
' Macro grabada el 15/08/2008 por usuario
'

ActiveWindow.Selection.SlideRange.Shapes("Rectangle 2").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1, Length:=0).Select
With ActiveWindow.Selection.TextRange
.Text = "LINGÁN CIEZA ROSA ELVIRA"
With .Font
.Name = "Arial"
.Size = 44
.Bold = msoFalse
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoFalse
.Emboss = msoFalse
.BaselineOffset = 0
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppTitle
End With
End With
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 3").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(Start:=1, Length:=0).Select
With ActiveWindow.Selection.TextRange
.Text = "ING. QUIMICA" + Chr$(CharCode:=13) + Chr$(CharCode:=13) + "SECCION: B"
With .Font
.Name = "Arial"
.Size = 32
.Bold = msoFalse
.Italic = msoFalse
.Underline = msoFalse
.Shadow = msoFalse
.Emboss = msoFalse
.BaselineOffset = 0
.AutoRotateNumbers = msoFalse
.Color.SchemeColor = ppForeground
End With
End With
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 2").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
With ActiveWindow.Selection.ShapeRange
.IncrementLeft 5.5
.IncrementTop -79.12
End With
ActiveWindow.Selection.SlideRange.Shapes("Rectangle 3").Select
ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Select
With ActiveWindow.Selection.ShapeRange
.IncrementLeft -20.12
.IncrementTop -64.38
End With
End Sub

MATRICES

Rango, Inversa y Determinante

La función detpermite calcular el determinante de una matriz en Matlab,
APLICACIONES:
Definimos la matriz,

>>X=[2 3 4; 1 -1 0]

X =

2 3 4

1 -1 0

Para calcular su rango,

>>rank(X)


ans =


2

Supongamos que tenemos definida la siguiente matriz,

H =

8 1 6

3 5 7

4 9 2

Para calcular su inversa,

>>inv(H)

ans =

0.1472 -0.1444 0.0639

-0.0611 0.0222 0.1056

-0.0194 0.1889 -0.1028

Y si queremos ver el resultado en forma racional,

>>format rational

>>inv(H)

ans =

53/360 -13/90 23/360

-11/180 1/45 19/180

-7/360 17/90 -37/360

(Para ver todas las opciones del comando format hacer help format)
Para calcular el determinante de la matriz anterior H,3

>>det(H)

ans =

-360


Bibliografía:
DELORES, M. Etter; “Solución de Problemas de Ingeniería con Matlab”;
Ed. Pretince Hall; Segunda Edición; México 1998.

ELABORADO POR: LINGÁN CIEZA ROSA ELVIRA
CICLO: I-“B” GRUPO Nro:1

No hay comentarios: