Professional Documents
Culture Documents
Seccion 1
Seccion 1
ans =
'19-Sep-2019'
a=8;
b=7;
a+b
ans =
15
a-b
ans =
c=a/b
c =
1.1429
who
a ans b c
whos
Name Size Bytes Class Attributes
a 1x1 8 double
ans 1x1 8 double
b 1x1 8 double
c 1x1 8 double
format long
pi
ans =
3.141592653589793
format short
pi
ans =
3.1416
format short e
pi
ans =
3.1416e+00
format long e
pi
ans =
3.141592653589793e+00
ans =
3.14159265358979e+000
ans =
3.1416e+000
format bank
pi
ans =
3.14
format rat
pi
ans =
355/113
format +
pi
ans =
-pi
ans =
-
ans =
format short
exp(0)
ans =
exp(1)
ans =
2.7183
inf
ans =
Inf
nan
ans =
NaN
realmin
ans =
2.2251e-308
realmax
ans =
1.7977e+308
ceil(pi)
ans =
floor(pi)
ans =
round(pi)
ans =
abs(-pi)
ans =
3.1416
sign(pi)
ans =
sign(-pi)
ans =
-1
sign(0)
ans =
gcd(9,12)
ans =
lcm(9,12)
ans =
36
log(10)
ans =
2.3026
log10(10)
ans =
log2(10)
ans =
3.3219
mod(-12,5)
ans =
ren(12,5)
{#Undefined function or variable 'ren'.
}#
rem(12,5)
ans =
sqrt(50)
ans =
7.0711
nthroot(50,3)
ans =
3.6840
nthroot(50,4)
ans =
2.6591
x=5+7i
x =
5.0000 + 7.0000i
y=3-7j
y =
3.0000 - 7.0000i
abs(x)
ans =
8.6023
angle(x)
ans =
0.9505
complex(9,-2)
ans =
9.0000 - 2.0000i
conj(x)
ans =
5.0000 - 7.0000i
imag(x)
ans =
real(x)
ans =
sign(x)
ans =
0.5812 + 0.8137i
isreal(x)
ans =
isreal(a)
ans =
clc
x=[-7,4,3,2 -1 6 -7]
x =
-7 4 3 2 -1 6 -7
y=x+3
y =
-4 7 6 5 2 9 -4
x+y
ans =
-11 11 9 7 1 15 -11
x(2)
ans =
x =
-7 4 3 2 -1 6 -7
x(5)
ans =
-1
x(end)
ans =
-7
x(1:2:5)
ans =
-7 3 -1
x =
-7 4 3 2 -1 6 -7
x=([3 5 1])
x =
3 5 1
x([3 5 1])
{#Index exceeds array bounds.
}#
x([3 5 1])
{#Index exceeds array bounds.
}#
x
x =
3 5 1
x=[-7,4,3,2 -1 6 -7]
x =
-7 4 3 2 -1 6 -7
x([3 5 1])
ans =
3 -1 -7
A=[1 2 3; 4,5,6; 7 8 9]
A =
1 2 3
4 5 6
7 8 9
A(2,1)
ans =
A(5)
ans =
A =
1 2 3
4 5 6
7 8 9
A(2,:)
ans =
4 5 6
A(:,2)
ans =
2
5
8
A(2,2:3)
ans =
5 6
A=([2 1],2:3)
A=([2 1],2:3)
#
{#Error: Invalid expression. When calling a function or indexing a variable, use
parentheses. Otherwise, check for
mismatched delimiters.
}#
A=([2 1],2:3)
A=([2 1],2:3)
#
{#Error: Invalid expression. When calling a function or indexing a variable, use
parentheses. Otherwise, check for
mismatched delimiters.
}#
A([2 1],2:3)
ans =
5 6
2 3
A(2,[3 1])
ans =
6 4
A(end,3)
ans =
(1:7)
ans =
1 2 3 4 5 6 7
(1:3:12)
ans =
1 4 7 10
(60:-6:1)
ans =
60 54 48 42 36 30 24 18 12 6
clc
zeros(5)
ans =
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
zeros(5,3)
ans =
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
ones(5,3)
ans =
1 1 1
1 1 1
1 1 1
1 1 1
1 1 1
ones(5)
ans =
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
ones(5,4)
ans =
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
1 1 1 1
rand(5)
ans =
rand(5)
ans =
rand(5,3)
ans =
randn(5)
ans =
randn(5,3)
ans =
randn(5,4)
ans =
eye(5)
ans =
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
eye(5,4)
ans =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
0 0 0 0
hilb(5)
ans =
hilb(5)
ans =
invhilp(5)
{#Undefined function or variable 'invhilp'.
}#
invhilb(5)
ans =
A =
1 2 3
4 5 6
7 8 9
B=A.^3
B =
1 8 27
64 125 216
343 512 729
C=A+B
C =
2 10 30
68 130 222
350 520 738
A-B
ans =
0 -6 -24
-60 -120 -210
-336 -504 -720
A*B
ans =
x =
4 5 6
y=[6 7 8]
y =
6 7 8
dot(x,y)
ans =
107
A=[1 2 3; 4 5 6; 7 8 9]
A =
1 2 3
4 5 6
7 8 9
det(A)
ans =
-9.5162e-16
diag(x)
ans =
4 0 0
0 5 0
0 0 6
eye(5)
ans =
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
hilb(5)
ans =
A^2
ans =
30 36 42
66 81 96
102 126 150
diag(A)
ans =
1
5
9
eig(A)
ans =
16.1168
-1.1168
-0.0000
inv(A)
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate.
RCOND = 2.202823e-18.
ans =
1.0e+16 *
lenght(A)
Undefined function or variable 'lenght'.
ans =
size(A)
ans =
3 3
null(A)
ans =
-0.4082
0.8165
-0.4082
orth(A)
ans =
-0.2148 0.8872
-0.5206 0.2496
-0.8263 -0.3879
pinv(A)
ans =
poly(A)
ans =
rank(A)
ans =
trace(A)
ans =
15
tril(A)
ans =
1 0 0
4 5 0
7 8 9
triu(A)
ans =
1 2 3
0 5 6
0 0 9
norm(A,3)
Error using norm
The only matrix norms available are 1, 2, inf, and 'fro'.
norm(A,1)
ans =
18
norm(A,2)
ans =
16.8481
help norm
norm - Vector and matrix norms
n = norm(v)
n = norm(v,p)
n = norm(X)
n = norm(X,p)
n = norm(X,'fro')
x =
4 5 6
y=[6 7 8]
y =
6 7 8
dot(x,y)
ans =
107
A=[1 2 3; 4 5 6; 7 8 9]
A =
1 2 3
4 5 6
7 8 9
det(A)
ans =
-9.5162e-16
diag(x)
ans =
4 0 0
0 5 0
0 0 6
eye(5)
ans =
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
hilb(5)
ans =
A^2
ans =
30 36 42
66 81 96
102 126 150
diag(A)
ans =
1
5
9
eig(A)
ans =
16.1168
-1.1168
-0.0000
inv(A)
[#Warning: Matrix is close to singular or badly scaled. Results may be inaccurate.
RCOND = 2.202823e-18.]#
ans =
1.0e+16 *
lenght(A)
{#Undefined function or variable 'lenght'.
}#
length(A)
ans =
size(A)
ans =
3 3
null(A)
ans =
-0.4082
0.8165
-0.4082
orth(A)
ans =
-0.2148 0.8872
-0.5206 0.2496
-0.8263 -0.3879
pinv(A)
ans =
poly(A)
ans =
rank(A)
ans =
trace(A)
ans =
15
tril(A)
ans =
1 0 0
4 5 0
7 8 9
triu(A)
ans =
1 2 3
0 5 6
0 0 9
norm(A,3)
{#Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('norm')"
style="font-weight:bold">norm</a>
The only matrix norms available are 1, 2, inf, and 'fro'.
}#
norm(A,1)
ans =
18
norm(A,2)
ans =
16.8481
norm(A,'fro')
ans =
16.8819
help norm
norm - Vector and matrix norms
n = norm(v)
n = norm(v,p)
n = norm(X)
n = norm(X,p)
n = norm(X,'fro')
normest(A)
ans =
16.8481