You are on page 1of 21

Viracucha Mosquera Dennis Alexander

{ Undefined function or variable 'Viracucha'.


}
NRC 2539
{ Undefined function or variable 'NRC'.
}
date

ans =

'02-Apr-2019'

clc
A=[pi 0;pi/3 pi/2]

A =

3.1416 0
1.0472 1.5708

find(A)

ans =

1
2
4

find devuelve los elementos que no son cero


{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('fin
d')" style="font-weight:bold">find</a>
Too many input arguments.
}
fliplr(A)

ans =

0 3.1416
1.5708 1.0472

fliplr(A) intercambia la matriz de izquierda a derecha


fliplr(A) intercambia la matriz de izquierda a derecha

{ Error: Unexpected MATLAB expression.


}
flipud(A)

ans =

1.0472 1.5708
3.1416 0

flipud(A) intercambia la matriz de arriba a abajo


flipud(A) intercambia la matriz de arriba a abajo

{ Error: Unexpected MATLAB expression.


}
reshape(A)
{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('res
hape')" style="font-weight:bold">reshape</a>
Not enough input arguments.
}
reshape(A,2,2)

ans =

3.1416 0
1.0472 1.5708

A =

3.1416 0
1.0472 1.5708

B=ones(3,2)

B =

1 1
1 1
1 1

reshape(B,2,2)
{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('res
hape')" style="font-weight:bold">reshape</a>
To RESHAPE the number of elements must not change.
}
reshape(B,3,2)

ans =

1 1
1 1
1 1

B=eye(3,2)

B =

1 0
0 1
0 0
reshape(B,3,2)

ans =

1 0
0 1
0 0

reshape(B,2,3)

ans =

1 0 1
0 0 0

A =

3.1416 0
1.0472 1.5708

reshape(A,2,2)

ans =

3.1416 0
1.0472 1.5708

A =

3.1416 0
1.0472 1.5708

A =

3.1416 0
1.0472 1.5708

rot90(A)

ans =

0 1.5708
3.1416 1.0472

rot90(A) rota 90 grados en sentido antihorario


rot90(A) rota 90 grados en sentido antihorario

{ Error: Unexpected MATLAB expression.


}
rot90(A,3)

ans =

1.0472 3.1416
1.5708 0

rot90(A,3) aplica 90 grados 3 veces


rot90(A,3) aplica 90 grados 3 veces

{ Error: Unexpected MATLAB expression.


}
expm(A)

ans =

23.1407 0
12.2201 4.8105

A =

3.1416 0
1.0472 1.5708

expm(A) toma el numero neperiano y lo eleva a cada elemento de la matriz


expm(A) toma el numero neperiano y lo eleva a cada elemento de la matriz

{ Error: Unexpected MATLAB expression.


}
logm(A)

ans =

1.1447 0
0.4621 0.4516

logm(A) aplica el logaritmo a cada elemento de la matriz a


logm(A) aplica el logaritmo a cada elemento de la matriz a

{ Error: Unexpected MATLAB expression.


}
sqrtm(A)

ans =

1.7725 0
0.3461 1.2533

sqrtm(A) saca la raiz cuadrada a cada elemento de A


sqrtm(A) saca la raiz cuadrada a cada elemento de A
{ Error: Unexpected MATLAB expression.
}
funm(A,@sin)

ans =

0.0000 0
-0.6667 1.0000

funm(A,@sin) calcula la funcion seno de cada elemento de la matriz


funm(A,@sin) calcula la funcion seno de cada elemento de la matriz

{ Error: Unexpected MATLAB expression.


}
clc
A=zeros(2,3)

A =

0 0 0
0 0 0

A=ones(2,3)

A =

1 1 1
1 1 1

A=zeros(2,3)

A =

0 0 0
0 0 0

B=zeros(2,3)

B =

0 0 0
0 0 0

B=ones(2,3)

B =

1 1 1
1 1 1

cat(1,A,B)

ans =
0 0 0
0 0 0
1 1 1
1 1 1

cat(2,A,B)

ans =

0 0 0 1 1 1
0 0 0 1 1 1

cat(3,A,B)

ans(:,:,1) =

0 0 0
0 0 0

ans(:,:,2) =

1 1 1
1 1 1

a='casa'

a =

'casa'

whos
Name Size Bytes Class Attributes

A 2x3 48 double
B 2x3 48 double
a 1x4 8 char
ans 2x3x2 96 double

b='gato'

b =

'gato'

a+b

ans =

202 194 231 208

a+0

ans =
99 97 115 97

b+0

ans =

103 97 116 111

abs(a)

ans =

99 97 115 97

double(a)

ans =

99 97 115 97

setstr(a)

ans =

'casa'

abs('a')-abs('A')

ans =

32

setstr(a-32)

ans =

'CASA'

disp(a)
casa
whos
Name Size Bytes Class Attributes

A 2x3 48 double
B 2x3 48 double
a 1x4 8 char
ans 1x4 8 char
b 1x4 8 char

disp('asi escribo texto aqui')


asi escribo texto aqui
disp('asi escribo texto aqui') asi envio mensajes de pantalla
disp('asi escribo texto aqui') asi envio mensajes de pantalla
{ Error: Unexpected MATLAB expression.
}
clc
estudiante.nombre='Alexander'

estudiante =

<a href="matlab:helpPopup struct" style="font-weight:bold">struct</a>


with fields:

nombre: 'Alexander'

estudiante.nombre='Alexander' crea estructuras y campos


estudiante.nombre='Alexander' crea estructuras y campos

{ Error: Unexpected MATLAB expression.


}
estudiante.apellido1='Viracucha'

estudiante =

<a href="matlab:helpPopup struct" style="font-weight:bold">struct</a>


with fields:

nombre: 'Alexander'
apellido1: 'Viracucha'

estudiante.apellido1='Viracucha' crea campos


estudiante.apellido1='Viracucha' crea campos

{ Error: Unexpected MATLAB expression.


}
estudiante.apellido2='Mosquera'

estudiante =

<a href="matlab:helpPopup struct" style="font-weight:bold">struct</a>


with fields:

nombre: 'Alexander'
apellido1: 'Viracucha'
apellido2: 'Mosquera'

estudiante.peso='70'

estudiante =

<a href="matlab:helpPopup struct" style="font-weight:bold">struct</a>


with fields:

nombre: 'Alexander'
apellido1: 'Viracucha'
apellido2: 'Mosquera'
peso: '70'

estudiante.edad='22'

estudiante =

<a href="matlab:helpPopup struct" style="font-weight:bold">struct</a>


with fields:

nombre: 'Alexander'
apellido1: 'Viracucha'
apellido2: 'Mosquera'
peso: '70'
edad: '22'

ciudadano(1)=struct('name','Mateo','lastname1','Viracucha','lastname2','M
osquera','weight','50','age','17')

ciudadano =

<a href="matlab:helpPopup struct" style="font-weight:bold">struct</a>


with fields:

name: 'Mateo'
lastname1: 'Viracucha'
lastname2: 'Mosquera'
weight: '50'
age: '17'

ciudadano(2)=struct('name','Christian','lastname1','Viracucha','lastname2
','Mosquera','weight','48','age','10')

ciudadano =

1×2 <a href="matlab:helpPopup struct" style="font-


weight:bold">struct</a> array with fields:

name
lastname1
lastname2
weight
age

ciudadano(1)

ans =

<a href="matlab:helpPopup struct" style="font-weight:bold">struct</a>


with fields:

name: 'Mateo'
lastname1: 'Viracucha'
lastname2: 'Mosquera'
weight: '50'
age: '17'

ciudadano(2)

ans =

<a href="matlab:helpPopup struct" style="font-weight:bold">struct</a>


with fields:

name: 'Christian'
lastname1: 'Viracucha'
lastname2: 'Mosquera'
weight: '48'
age: '10'

ciudadano()

ans =

1×2 <a href="matlab:helpPopup struct" style="font-


weight:bold">struct</a> array with fields:

name
lastname1
lastname2
weight
age

ciudadano.age()
{ Expected one output from a curly brace or dot indexing expression, but
there
were 2 results.
}
ciudadano.age

ans =

'17'

ans =

'10'

isfield(ciudadano)
{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('isf
ield')" style="font-weight:bold">isfield</a>
Not enough input arguments.
}
isfield(ciudadano,'weight')

ans =
<a href="matlab:helpPopup logical" style="font-weight:bold">logical</a>

isstruct(ciudadano)

ans =

<a href="matlab:helpPopup logical" style="font-weight:bold">logical</a>

isstruct(estudiante)

ans =

<a href="matlab:helpPopup logical" style="font-weight:bold">logical</a>

rmfield('ciudadano','apellido2')
{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('rmf
ield', 'C:\Program
Files\MATLAB\R2017b\toolbox\matlab\datatypes\rmfield.m', 19)"
style="font-weight:bold">rmfield</a> (<a href="matlab:
opentoline('C:\Program
Files\MATLAB\R2017b\toolbox\matlab\datatypes\rmfield.m',19,0)">line
19</a>)
S must be a structure array.
}
rmfield('ciudadano','lastname2')
{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('rmf
ield', 'C:\Program
Files\MATLAB\R2017b\toolbox\matlab\datatypes\rmfield.m', 19)"
style="font-weight:bold">rmfield</a> (<a href="matlab:
opentoline('C:\Program
Files\MATLAB\R2017b\toolbox\matlab\datatypes\rmfield.m',19,0)">line
19</a>)
S must be a structure array.
}
rmfield(ciudadano,'lastname2')

ans =

1×2 <a href="matlab:helpPopup struct" style="font-


weight:bold">struct</a> array with fields:

name
lastname1
weight
age
rmfield(ciudadano,'lastname2') borra un campo
rmfield(ciudadano,'lastname2') borra un campo

{ Error: Unexpected MATLAB expression.


}
fieldnames(estudiante)

ans =

5×1 <a href="matlab:helpPopup cell" style="font-weight:bold">cell</a>


array

{'nombre' }
{'apellido1'}
{'apellido2'}
{'peso' }
{'edad' }

fieldnames(estudiante) devuelve los campos que estan en esa estructura


fieldnames(estudiante) devuelve los campos que estan en esa estructura

{ Error: Unexpected MATLAB expression.


}
ciudadano()

ans =

1×2 <a href="matlab:helpPopup struct" style="font-


weight:bold">struct</a> array with fields:

name
lastname1
lastname2
weight
age

clc
cel{1}=[1 2 3 4]

cel =

1×1 <a href="matlab:helpPopup cell" style="font-weight:bold">cell</a>


array

{1×4 double}

cel{2}={'escuela politecnica'}

cel =

1×2 <a href="matlab:helpPopup cell" style="font-weight:bold">cell</a>


array

{1×4 double} {1×1 cell}


cel{2}='escuela politecnica'

cel =

1×2 <a href="matlab:helpPopup cell" style="font-weight:bold">cell</a>


array

{1×4 double} {'escuela politecnica'}

cel{3}=eye(4)

cel =

1×3 <a href="matlab:helpPopup cell" style="font-weight:bold">cell</a>


array

{1×4 double} {'escuela politecnica'} {4×4 double}

cel{4}=-pi

cel =

1×4 <a href="matlab:helpPopup cell" style="font-weight:bold">cell</a>


array

{1×4 double} {'escuela politec…'} {4×4 double} {[-3.1416]}

ce={[4 5 6],'ingenieros espe',ones(3),-exp(1)}

ce =

1×4 <a href="matlab:helpPopup cell" style="font-weight:bold">cell</a>


array

{1×3 double} {'ingenieros espe'} {3×3 double} {[-2.7183]}

celldisp(cel)

cel{1} =

1 2 3 4

cel{2} =

escuela politecnica

cel{3} =

1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1

cel{4} =

-3.1416

cellplot(cel)

cellplot(ce)
cellplot(ce)
cellplot(cel)
cell(2,)
cell(2,)

{ Error: Unbalanced or unexpected parenthesis or bracket.


}
cell(2,4)

ans =

2×4 <a href="matlab:helpPopup cell" style="font-weight:bold">cell</a>


array

{0×0 double} {0×0 double} {0×0 double} {0×0 double}


{0×0 double} {0×0 double} {0×0 double} {0×0 double}

A =

0 0 0
0 0 0

A=eye(5)

A =
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1

num2cell(A)

ans =

5×5 <a href="matlab:helpPopup cell" style="font-weight:bold">cell</a>


array

{[1]} {[0]} {[0]} {[0]} {[0]}


{[0]} {[1]} {[0]} {[0]} {[0]}
{[0]} {[0]} {[1]} {[0]} {[0]}
{[0]} {[0]} {[0]} {[1]} {[0]}
{[0]} {[0]} {[0]} {[0]} {[1]}

iscell(cel)

ans =

<a href="matlab:helpPopup logical" style="font-weight:bold">logical</a>

clc
x=[1:8]

x =

1 2 3 4 5 6 7 8

y=8-x

y =

7 6 5 4 3 2 1 0

r=x>6

r =

1×8 <a href="matlab:helpPopup logical" style="font-


weight:bold">logical</a> array

0 0 0 0 0 0 1 1

r=x>6 verifica el operador lógico regresando 1 o 0


r=x>6 verifica el operador lógico regresando 1 o 0

{ Error: Unexpected MATLAB expression.


}
q=x==y

q =

1×8 <a href="matlab:helpPopup logical" style="font-


weight:bold">logical</a> array

0 0 0 1 0 0 0 0

q=x==y compara si son iguales


q=x==y compara si son iguales

{ Error: Unexpected MATLAB expression.


}
t=x!=y
t=x!=y

{ Error: Unexpected MATLAB operator.


}
t=x~=y

t =

1×8 <a href="matlab:helpPopup logical" style="font-


weight:bold">logical</a> array

1 1 1 0 1 1 1 1

t=x!=y
t=x!=y

{ Error: Unexpected MATLAB operator.


}
t=x~=y

t =

1×8 <a href="matlab:helpPopup logical" style="font-


weight:bold">logical</a> array

1 1 1 0 1 1 1 1

v=(x>y)&(y>-3)

v =

1×8 <a href="matlab:helpPopup logical" style="font-


weight:bold">logical</a> array

0 0 0 0 1 1 1 1

v=(x>y)&(y>-3) operaciones lógicas con operadores lógicos


v=(x>y)&(y>-3) operaciones lógicas con operadores lógicos
{ Error: Unexpected MATLAB expression.
}
k=[inf nan 0 8 -10 100]

k =

Inf NaN 0 8 -10 100

exist('k')

ans =

exist('k') existe el vector k?


exist('k') existe el vector k?

{ Error: Unexpected MATLAB expression.


}
isnan(k)

ans =

1×6 <a href="matlab:helpPopup logical" style="font-


weight:bold">logical</a> array

0 1 0 0 0 0

isnan(k) donde exista un valor nan devuelva 1


isnan(k) donde exista un valor nan devuelva 1

{ Error: Unexpected MATLAB expression.


}
isinf(k)

ans =

1×6 <a href="matlab:helpPopup logical" style="font-


weight:bold">logical</a> array

1 0 0 0 0 0

isinf(k) si existe indeterminacion devuelva 1


isinf(k) si existe indeterminacion devuelva 1

{ Error: Unexpected MATLAB expression.


}
isfinite(k)

ans =

1×6 <a href="matlab:helpPopup logical" style="font-


weight:bold">logical</a> array
0 0 1 1 1 1

Orden presedencia operadores


{ Undefined function or variable 'Orden'.
}
1)^ .^ ' .'
1)^ .^ ' .'

{ Error: Unbalanced or unexpected parenthesis or bracket.


}
2) * / \ .* ./ .\
2) * / \ .* ./ .\

{ Error: Unbalanced or unexpected parenthesis or bracket.


}
3)+ - ~ +(unario) -(unario)
3)+ - ~ +(unario) -(unario)

{ Error: Unbalanced or unexpected parenthesis or bracket.


}
4) : > < >= <= == ~=
4) : > < >= <= == ~=

{ Error: Unbalanced or unexpected parenthesis or bracket.


}
5)| &
5)| &

{ Error: Unbalanced or unexpected parenthesis or bracket.


}

clc
x=[1 5 4]

x =

1 5 4

y=[3 8 9]

y =

3 8 9

x =

1 5 4

plot(x)
c=conv(x,y)

c =
3 23 61 77 36

c=conv(x,y) se multiplica los dos polinomios


c=conv(x,y) se multiplica los dos polinomios

{ Error: Unexpected MATLAB expression.


}
deconv(ans,y)

ans =

0 0 0.3333 -0.5556

deconv(c,y)

ans =

1 5 4

whos
Name Size Bytes Class Attributes

A 5x5 200 double


B 2x3 48 double
a 1x4 8 char
ans 1x3 24 double
b 1x4 8 char
c 1x5 40 double
ce 1x4 582 cell
cel 1x4 654 cell
ciudadano 1x2 1552 struct
estudiante 1x1 940 struct
k 1x6 48 double
q 1x8 8 logical
r 1x8 8 logical
t 1x8 8 logical
v 1x8 8 logical
x 1x3 24 double
y 1x3 24 double

c =

3 23 61 77 36

polyder(c)

ans =

12 69 122 77

polyder(c) derivada del polinomio


polyder(c) derivada del polinomio

{ Error: Unexpected MATLAB expression.


}
polyder(x,y)

ans =

12 69 122 77

polyder(x,y) multiplica los polinomios y luego lo deriva


polyder(x,y) multiplica los polinomios y luego lo deriva

{ Error: Unexpected MATLAB expression.


}
polyval(c,3)

ans =

1680

diary off

You might also like