Está en la página 1de 40

n

t
o

s
i
n
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

CURSODESCILAB
INTRODUCCIN
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
INTRODUCCIN
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
PARTEII PARTEII
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
Elaboradopor:Prof.EnriqueEduardoGavorskisSouto
e.gavorskis@hotmail.es
Revisadopor:Prof.FranciscoM.GonzalezLongatt
fglongatt@ieee org
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
fglongatt@ieee.org
n
t
o

s
i
n
CONTENIDO CONTENIDO
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e CONTENIDO CONTENIDO
El programa
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

Elprograma
EntornosdeTrabajo
Uso del Help
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
UsodelHelp
OperacionesconVectoresyMatrices
O i F i
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
OperacionesconFunciones
Graficacin
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
Programacin
Debugger
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
GRFICOS: 2D Y 3D GRFICOS: 2D Y 3D
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e GRFICOS:2DY3D GRFICOS:2DY3D
SCILAB dispone de varias funciones bsicas para crear grficos
2D. Pero la principal funcin es la siguiente:
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

o
2 D. Pero la principal funcin es la siguiente:
plot2d(x,y) crea un grfico a partir de vectores y/o
columnas de matrices, con escalas sobre ambos ejes.
style Esta opcin sirve para definir como ser dibujada la curva
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
style Esta opcin sirve para definir como ser dibujada la curva.
logflag Dicha opcin se emplea para seleccionar el tipo de escala sobre
los ejes.
rect Esta opcin puede ser usada para fijar los rangos de los ejes
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r rect Esta opcin puede ser usada para fijar los rangos de los ejes
mnimos requeridos para la grfica. Si esta opcin es especificada, los
valores asociados debern ser dados como un vector con nmeros reales
de cuatro entradas: [xmin,ymin,xmax,ymax].
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
frameflag Esta opcin puede ser usada para controlar el cmputo actual
de los rangos de las coordenadas para los valores mnimos requeridos.
Los rangos en uso pueden tener requerimientos mayores o menores.
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
nax, leg
n
t
o

s
i
n
STYLE STYLE
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
yyellow .point solid
m magenta o circle dashed
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

mmagenta ocircle dashed


ccyan xxmark.dashdot
rred +plusppentagram
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
p p p g
ggreen *star ^triangle(up)
bblue ssquare <triangle(left)
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
wwhite ddiamond >triangle(right)
kblack :dotted vtriangle(down)
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
hhexagram
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
GRFICOS: 2D Y 3D GRFICOS: 2D Y 3D
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
Existen funciones orientadas a aadir ttulos al grfico
GRFICOS:2DY3D GRFICOS:2DY3D
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

Existen funciones orientadas a aadir ttulos al grfico,


a los ejes, a dibujar una cuadrcula auxiliar, etc.
title('ttulo') aade un ttulo al dibujo
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
title( ttulo ) aade un ttulo al dibujo
xlabel('Nombre del Eje x') aade una
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
etiqueta al eje de abscisas.
ylabel('Nombre del Eje y') idem al eje
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
ylabel( Nombre del Eje y ) idem al eje
de ordenadas.
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
xgrid activa una cuadrcula en el dibujo.
n
t
o

s
i
n
GRFICOS: 2D Y 3D GRFICOS: 2D Y 3D
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
plot es la funcin clave de todos los grficos
2D en MATLAB Ya se ha dicho que el
GRFICOS:2DY3D GRFICOS:2DY3D
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

2 D en MATLAB. Ya se ha dicho que el


elemento bsico de los grficos
bidimensionales es el vector
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
bidimensionales es el vector.
x=[1 3 2 4 5 3]
x =
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
1 3 2 4 5 3
plot(x)
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
GRFICOS: 2D Y 3D GRFICOS: 2D Y 3D
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
La funcin plot(), no hace otra cosa que dibujar
vectores.
GRFICOS:2DY3D GRFICOS:2DY3D
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

x=[1 3 2 4 5 3]
x =
1 3 2 4 5 3
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
1 3 2 4 5 3
plot(x)
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
COMANDOPLOT COMANDOPLOT COMANDOPLOT COMANDOPLOT
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
Es el comando ms utilizado para grficos en
2D
Es el comando ms utilizado para grficos en
2D
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

2D
Representa grficamente conjuntos de arrays
2D
Representa grficamente conjuntos de arrays
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
de datos:
Elige automticamente los ejes apropiados
de datos:
Elige automticamente los ejes apropiados
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
Por defecto, conecta los datos mediante
lneas rectas
Por defecto, conecta los datos mediante
lneas rectas
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
lneas rectas lneas rectas
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
EJEMPLO EJEMPLO
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
x=0:%pi/90:2*%pi;
y=sin(x).*cos(x);
plot(x,y)
EJEMPLO EJEMPLO
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

xgrid
xlabel('eje x (en radianes)')
ylabel('eje y')
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
ylabel( eje y )
title('y=sen(x)*cos(x)')
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
OTROS COMANDOS UTILES OTROS COMANDOS UTILES
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
xgetmouse xgetmouse
Determina las coordenadas
OTROSCOMANDOSUTILES OTROSCOMANDOSUTILES
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

del punto en donde se ubique


el puntero del mouse
xclick xclick
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
xclick xclick
Calcular las coordenadas de
puntos sobre la curva
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
xstring() xstring()
Insertar textos en una figura
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
isoview() isoview()
Escalaisomtricas
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
EJEMPLO EJEMPLO
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
) 2 ( 2
Calcular grficamente las soluciones de la ecuacin
EJEMPLO EJEMPLO
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

xi=0;h=%pi/360;xf=%pi/4;
4 . 0
2
) 2 cos( 2

x x
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
xi=0;h=%pi/360;xf=%pi/4;
teta=xi:h:xf;
f1=(2*teta-cos(2*teta))/2;
f2=0.4*ones(sin(f1));
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
figure
plot(teta,f1,'g--',teta,f2,'r')
xlabel('ngulo (radianes)')
xclick
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c xclick
xstring(0.2,0.43,'2x-cos(2x))/2')
// Cambie los valores de 0.2 y 0.43
// por las dos ultimas cifras que arroja xclick
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
title('Raiz aproximada')
n
t
o

s
i
n
EJEMPLO EJEMPLO
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
EJEMPLOS EJEMPLOS
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
x = [11 14 15 16 17];
y = [695 750 705 720 690];
( )
EJEMPLOS EJEMPLOS
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

plot(x,y,r*:),
title('Indice general de la Bolsa de Madrid'),
xlabel('Septiembre 1998')
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
740
750
Indice general de la Bolsa de Madrid
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
720
730
740
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
700
710
720
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
11 12 13 14 15 16 17
690
700
Septiembre 1998
n
t
o

s
i
n
EJEMPLO EJEMPLO
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
x=0:%pi/180:2*%pi;
y=sin(x);
z=cos(x);
EJEMPLO EJEMPLO
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

z=cos(x);
plot(x,y,x,z)
A=[y' z']
plot(x,A)
0.8
1
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
0.2
0.4
0.6
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
-0.2
0
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
-0 8
-0.6
-0.4
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
0 1 2 3 4 5 6 7
-1
0.8
n
t
o

s
i
n
GRFICAS EN 2D Y 3D
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e GRFICASEN2DY3D
Funcin eval se utiliza con funciones
definidas con un carcter y =
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

definidas con un carcter. y =


eval(caracter)
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
f= 'sin(x)-2*cos(x)';
x=0:%pi/90:2*%pi;
y=eval(f);
plot2d(x,y,nax=[0,6,0,2.4],rect=[0,0,6,2.4])
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r plot2d(x,y,nax [0,6,0,2.4],rect [0,0,6,2.4])
[b,xb,yb]= xclick();
xstring(xb,yb,' sen(x)-2cos(x) ')
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
COMANDOS COMANDOS UTILES UTILES
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e COMANDOS COMANDOSUTILES UTILES
Llamar una nueva figura figure o para
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

Llamar una nueva figura figure o para


referirse a una figura ya hecha figure(n)
Borrar la figura actual clf
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
Borrar la figura actual clf
close all borra todas las figuras.
l (fi ( )) b l fi
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
close(figure(n)) borra la figura n
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
COMANDOS COMANDOS UTILES UTILES
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e COMANDOS COMANDOSUTILES UTILES
Una ventana grfica se puede dividir en m
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

Una ventana grfica se puede dividir en m


particiones horizontales y n verticales, con
objeto de representar mltiples grficos en
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
objeto de representar mltiples grficos en
ella.
Cada una de estas subventanas tiene sus
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
Cada una de estas subventanas tiene sus
propios ejes, aunque otras propiedades son
comunes a toda la figura
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
comunes a toda la figura.
La forma general de este comando es:
b l t( i) S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
subplot(m,n,i)
n
t
o

s
i
n
COMANDOS COMANDOS UTILES UTILES
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e COMANDOS COMANDOSUTILES UTILES
subplot(m,n,i) donde m y n son el
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

subplot(m,n,i) donde m y n son el


nmero de subdivisiones en filas y columnas,
e i es la subdivisin que se convierte en activa
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
e i es la subdivisin que se convierte en activa.
Las subdiviones se numeran
consecutivamente empezando por las de la
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
consecutivamente empezando por las de la
primera fila, siguiendo por las de la segunda,
etc
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c etc.
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
EJEMPLO EJEMPLO
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e EJEMPLO EJEMPLO
x=[0:0.1:2*%pi];
subplot(121)
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

p ( )
plot(x,sin(x)+2*sin(2*x+0.5)+sin(3*x))
subplot(122)
plot2d2(x,sin(x))
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
CURVAS DE LISAJOUX CURVAS DE LISAJOUX
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
CURVASDELISAJOUX CURVASDELISAJOUX
t = 0: 2*%pi / 100: 2*%pi ;
x =si n( 2*t ) ;
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

y =si n( 3*t ) ;
pl ot ( y, x)
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
DIAGRAMASDE DIAGRAMASDE

p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
RADIACINDEANTENAS RADIACINDEANTENAS
z = 0: 0. 1: 2*%pi ;
r = si n( 5*z) ;
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

r si n( 5 z) ;
pol ar pl ot ( z, r )
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
NOTEN QUE EN EL TRAZO DE LA
CURVA PRESENTA
IRREGULARIDADES, ELLO PUEDE

p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
OCURRIR SI EL NMERO DE PUNTOS
A GRAFICAR SON RELATIVAMENTE
POCOS, PARA ESTE EJEMPLO ELLO SE
PUEDE ARREGLAR DISMINUYENDO
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
PUEDE ARREGLAR DISMINUYENDO
EL PASO DE 0.1 A 0.01
n
t
o

s
i
n
OTRAS FUNCIONES EN 2D OTRAS FUNCIONES EN 2D
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
bar() crea diagramas de barras.
OTRASFUNCIONESEN2D OTRASFUNCIONESEN2D
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

barh() diagramas de barras horizontales.


pie() grficos con forma de torta.
h () fi d t i l
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
champ() graficas de campos vectoriales
fchamp() campo vectorial (2D) correspondiente
una EDO de segundo orden
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
una EDO de segundo orden.
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
GRFICOS: 2D Y 3D GRFICOS: 2D Y 3D
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
Funciones grficas 3D elementales:
GRFICOS:2DY3D GRFICOS:2DY3D
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

La funcin plot3d es anloga a su homloga


bidimensional plot. Su forma ms sencilla es la
siguiente:
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
siguiente:
plot3d(x,y,z)
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r plot3d(x,y,z)
Aunque tambin existen otros comando de graficacin
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
en 3d como param3d
t =l i nspace( 0, 4*%pi , 100) ;
par am3d( cos( t ) si n( t ) t )
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
par am3d( cos( t ) , si n( t ) , t )
n
t
o

s
i
n
SURF SURF
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e SURF SURF
f unct i on z=f ( x, y)
z=2*x^2+y^2;
df t i
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

endf unct i on
x=l i nspace( - 1, 1, 100) ;
y=l i nspace( - 2, 2, 200) ;
z=( f eval ( x, y, f ) ) ' ;
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
cl f
sur f ( x, y, z)
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
GRFICOS:2DY3D GRFICOS:2DY3D
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
Representacin grfica de superficies. mesh(x,y,Z),
Creacin de una malla [X, Y]=meshgrid(x,y)
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

Grfica de la malla construida sobre la superficie z


mesh(X,Y,Z)
Otros graficados surf plot3d1
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
Otros graficados surf, plot3d1
x=[0:2:200];y=[0:50];
// Obtenemos la malla del dominio
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
[X Y]=meshgrid(x,y);
length(x),length(y)
size(X), size(Y)
Z=X.^2-Y.^2;
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
Z X. 2 Y. 2;
figure(1);mesh(X,Y,Z)
figure(2);surf(X,Y,Z)
figure(3);plot3d1(X,Y,Z)
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
f or j =1: 10
x=0: 0. 01: 2*%pi ;
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

p ;
pl ot ( x, si n( j *x) / 2)
cl f
end
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

PROGRAMACINENSCILAD
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
INTRODUCCIN
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
INTRODUCCIN
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
SCE SCE FILES FILES SCE SCE FILES FILES
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
Quson?
Paraqu
sirven?
Tiposde
archivos sci
Caractersticas
de funciones
Ejemplode
funcin
Pasosque
sigue SCILAB
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
sirven? archivossci defunciones funcin sigueSCILAB
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
QUSONLOS QUSONLOSSCE SCEFILES? FILES? QUSONLOS QUSONLOSSCE SCEFILES? FILES?
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
SCILAB permite crear funciones nuevas en
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

SCILABpermitecrearfuncionesnuevasen
formadearchivosconextensin*.sce y
almacenarlos
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
almacenarlos
Unarchivo*.sce esunasecuenciaderdenes
de SCILAB que puede contener incluso
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
deSCILABquepuedecontener,incluso,
referenciasaotrosarchivo*.sce
L hi * ASCII d
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
Losarchivo*.sce sontextosASCIIcreadoscon
cualquiereditoroprocesadordetexto
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
QUSONLOS QUSONLOSSCE SCEFILES? FILES? QUSONLOS QUSONLOSSCE SCEFILES? FILES?
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
Seinvocandesde
la ventana da
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

Contienen
rdenes(lneas
laventanada
rdenesodesde
otroarchivo.sce
Seeditany
graban como
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
decomandos)de
SCILAB
grabancomo
ficherosASCII
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
SCE FILES
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
SCEFILES
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
PARAQUSIRVEN? PARAQUSIRVEN? PARAQUSIRVEN? PARAQUSIRVEN?
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

Automatizar secuencias de rdenes


que se utilizan de forma repetitiva
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
que se utilizan de forma repetitiva.
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
Proporcionar extensibilidad a
SCILAB con la posibilidad de aadir
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
nuevas funciones cuya utilizacin
no difiere de las que incluye
originalmente
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
originalmente.
n
t
o

s
i
n
TIPOSDE TIPOSDESCE SCE FILES FILES TIPOSDE TIPOSDESCE SCE FILES FILES
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
Archivospredefinidos:
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

p
Seno,Coseno,Tangente.
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
Archivospropios:
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
Sonuncompendiodefuncionespredefinidasya
t i t t
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
seamatrices,vectores,senos,cosenos,etc.que
generanunprogramanuevoyespecifico
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
CARACTERSTICAS DE FUNCIONES CARACTERSTICAS DE FUNCIONES CARACTERSTICAS DE FUNCIONES CARACTERSTICAS DE FUNCIONES
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
CARACTERSTICASDEFUNCIONES CARACTERSTICASDEFUNCIONES CARACTERSTICASDEFUNCIONES CARACTERSTICASDEFUNCIONES
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

Elnombredelafuncinydelarchivodebeserel
mismo
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
EstaseejecutadesdeelentornodeSCILAB por
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
j p
primeravez.
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
Soncapacesdegenerarprogramasemergentesy
trabajarenunentornofueradelSCILAB,perolos
l l d d d d l
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
clculossiguensiendoejecutadosdentrodelSCILAB.
n
t
o

s
i
n
ADQUISICINDEDATOS ADQUISICINDEDATOS ADQUISICINDEDATOS ADQUISICINDEDATOS
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
// Ubica, extrae y/o abre el documento de Excel
[fd,SST,Sheetnames,Sheetpos] =
xls open('C:\ \Nombre del Archivo xls');
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

xls_open( C:\...\Nombre_del_Archivo.xls );
// Lee la primera hoja de clculo
[Value,TextInd] = xls_read(fd, Sheetpos(1));
// Cierra el documento
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
mclose(fd)
Value
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
EXISTEN OTRAS FORMAS DE IMPORTAR DATOS DE EXCEL,
MEDIANTE OTROS COMANDOS COMO POR EJEMPLO
readxls.
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
CLARO QUE TAMBIN ES POSIBLE LEER DATOS DE OTROS
TIPOS DE ARCHIVOS, COMO POR EJEMPLO ARCHIVOS DE
SONIDO .WAV MEDIANTE EL COMANDO wavread
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
COMANDOS COMANDOS i f i f ,, el sei f el sei f yy el se el se COMANDOS COMANDOS i f i f ,, el sei f el sei f yy el se el se
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
COMANDOS COMANDOSi f i f , ,el sei f el sei f y yel se el se COMANDOS COMANDOSi f i f , ,el sei f el sei f y yel se el se
i=2
for j = 1:3,
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

if i == j then
a(i,j) = 2;
elseif abs(i-j) == 1
then a(i,j) = -1;
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
then a(i,j) 1;
else a(i,j) = 0;
end,
end
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
n
t
o

s
i
n
COMANDO COMANDO whi l e whi l e
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
k = round(rand(1)*10);
i_max = 5;
it num = 1;
COMANDO COMANDOwhi l e whi l e
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

it_num = 1;
while it_num < k
a(it_num,1)= 3*rand(1) + 5*sin(rand(1)*%pi);
it_num = it_num +1;
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
if it_num == i_max then
break
end
end
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
end
if it_num == k then
disp('El porgrama converge (k = it_num)')
else
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
disp('Nmero de Iteraciones Excedidos (it_num = 5)')
end
disp('La matriz resultante es: ')
disp(' ')
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org
disp( )
disp(a)
n
t
o

s
i
n
p
a
r
c
i
a
l

d
e

e
s
t
e

d
o
c
u
m
e
o

l
a

r
e
p
r
o
d
u
c
c
i

t
o
t
a
l

Preguntas
o

a
c
a
d

m
i
c
o
s
.

P
r
o
h
i
b
i
d
o
r
.

S
e
p
t
i
e
m
b
r
e

2
0
1
0
Preguntas
o
b
j
e
t
i
v
o

d
e

e
v
a
l
u
a
c
i

n
,

o
h
o
s

r
e
s
e
r
v
a
d
o
s

d
e

a
u
t
o
r
p
a
r
a

s
e
r

e
m
p
l
e
a
d
o

c
o
n

o
r
i
z
a
c
i

d
e
l

a
u
t
o
r
.

D
e
r
e
c
S
o
l
o

p
a
u
t
o
r
Prof.EnriqueEduardoGavorskisSouto,e.gavorskis@hotmail.es /ProfFranciscoM.GonzalezLongatt,fglongatt@ieee.org

También podría gustarte