Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

nrc:2775

{ Undefined function or variable 'nrc'.


}
alumno: Kevin Cedillo
alumno: Kevin Cedillo

{ Error: Unexpected MATLAB expression.


}
date

ans =

'20-Sep-2019'

clc
a=15

a =

15

b=7;
a+b

ans =

22

a-b

ans =

a*b

ans =

105

a/b

ans =

2.1429

a^b

ans =

170859375

who

Your variables are:

a ans b
whos
Name Size Bytes Class Attributes

a 1x1 8 double
ans 1x1 8 double
b 1x1 8 double

clc
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

format short eng


pi

ans =

3.1416e+000

format short long


{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('for
mat')" style="font-weight:bold">format</a>
Unrecognized command option short.
}
format long eng
pi

ans =

3.14159265358979e+000

format bank
pi
ans =

3.14

formaat hex
{ Undefined function or variable 'formaat'.
}
format hex
pi

ans =

400921fb54442d18

format rat
pi

ans =

355/113

format +
pi

ans =

-pi

ans =

ans =

format short
inf

ans =

Inf

NAN
{ Undefined function or variable 'NAN'.
}
nan

ans =

NaN

real min
ans =

109 105 110

realmin

ans =

2.2251e-308

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

ans =

1.7977e+308

ceil(pi
ceil(pi

{ Error: Expression or statement is incorrect--possibly unbalanced (, {,


or [.
}
ceil(pi)

ans =

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

ans =

flor(pi)
{ Undefined function or variable 'flor'.
}
floor(pi)
ans =

round(pi)

ans =

abs(-pi)

ans =

3.1416

sign(pi)

ans =

sign(-pi
sign(-pi

{ Error: Expression or statement is incorrect--possibly unbalanced (, {,


or [.
}
sign(-pi)

ans =

-1

sign(0)

ans =

pxp(0)
{ Undefined function or variable 'pxp'.
}
exp(0)

ans =

exp(2)

ans =

7.3891

gcd(9.12)
{ Not enough input arguments.
Error in <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('gcd
', 'E:\toolbox\matlab\specfun\gcd.m', 25)" style="font-
weight:bold">gcd</a> (<a href="matlab:
opentoline('E:\toolbox\matlab\specfun\gcd.m',25,0)">line 25</a>)
if ~isequal(size(a),size(b)) && ~isscalar(a) && ~isscalar(b)
}
gcd(9,12)

ans =

gcd(12,2)

ans =

lcm(12,2)

ans =

12

lcm(9,12)

ans =

36

log(10)

ans =

2.3026

log2(10)

ans =

3.3219

log10(10)

ans =

mod(-12,5)

ans =

rem(12,5)

ans =
2

sqrt(50)

ans =

7.0711

nthroot(50,3)

ans =

3.6840

x=3+5i

x =

3.0000 + 5.0000i

whos
Name Size Bytes Class Attributes

a 1x1 8 double
ans 1x1 8 double
b 1x1 8 double
x 1x1 16 double complex

y=2-4j

y =

2.0000 - 4.0000i

abs(x)

ans =

5.8310

real(x)

ans =

imag(x)

ans =

conj(x)

ans =

3.0000 - 5.0000i
complex(5,-4)

ans =

5.0000 - 4.0000i

sign(x)

ans =

0.5145 + 0.8575i

angle(x)

ans =

1.0304

isreal(x)

ans =

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

whos
Name Size Bytes Class Attributes

a 1x1 8 double
ans 1x1 1 logical
b 1x1 8 double
x 1x1 16 double complex
y 1x1 16 double complex

x(2)
{ Index exceeds matrix dimensions.
}
x=[3,4 -5,2 8,8]

x =

3 4 -5 2 8 8

x=(|1 3 5])
x=(|1 3 5])

{ Error: Unexpected MATLAB operator.


}
A=[1 2 3;4 5 6;7 8 9]

A =

1 2 3
4 5 6
7 8 9
A(2;2:3)
A(2;2:3)

{ Error: Unbalanced or unexpected parenthesis or bracket.


}
A(2,2:3)

ans =

5 6

A(2,[3 1])

ans =

6 4

A(end,[1 3])

ans =

7 9

(1:7)

ans =

1 2 3 4 5 6 7

(1:10:10)

ans =

(1:3:10)

ans =

1 4 7 10

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

one(5)
{ Undefined function or variable 'one'.
}
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,3)

ans =

1 1 1
1 1 1
1 1 1
1 1 1
1 1 1

column 6
{ Undefined function or variable 'column'.
}
Column 6
{ Undefined function or variable 'Column'.
}
rand

ans =

0.8147

rand(6)

ans =

0.9058 0.5469 0.4854 0.9595 0.7577 0.0318


0.1270 0.9575 0.8003 0.6557 0.7431 0.2769
0.9134 0.9649 0.1419 0.0357 0.3922 0.0462
0.6324 0.1576 0.4218 0.8491 0.6555 0.0971
0.0975 0.9706 0.9157 0.9340 0.1712 0.8235
0.2785 0.9572 0.7922 0.6787 0.7060 0.6948

rand(5,2)

ans =

0.3171 0.7655
0.9502 0.7952
0.0344 0.1869
0.4387 0.4898
0.3816 0.4456

randn(5)

ans =

0.6277 -1.2141 0.3714 0.5525 -0.7423


1.0933 -1.1135 -0.2256 1.1006 -1.0616
1.1093 -0.0068 1.1174 1.5442 2.3505
-0.8637 1.5326 -1.0891 0.0859 -0.6156
0.0774 -0.7697 0.0326 -1.4916 0.7481
randn(5,2)

ans =

-0.1924 0.4882
0.8886 -0.1774
-0.7648 -0.1961
-1.4023 1.4193
-1.4224 0.2916

eye(4)

ans =

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

eye(4,3)

ans =

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

hilb(5)

ans =

1.0000 0.5000 0.3333 0.2500 0.2000


0.5000 0.3333 0.2500 0.2000 0.1667
0.3333 0.2500 0.2000 0.1667 0.1429
0.2500 0.2000 0.1667 0.1429 0.1250
0.2000 0.1667 0.1429 0.1250 0.1111

hilb(5)

ans =

1.0000 0.5000 0.3333 0.2500 0.2000


0.5000 0.3333 0.2500 0.2000 0.1667
0.3333 0.2500 0.2000 0.1667 0.1429
0.2500 0.2000 0.1667 0.1429 0.1250
0.2000 0.1667 0.1429 0.1250 0.1111

invhilb(5)

ans =

25 -300 1050 -1400 630


-300 4800 -18900 26880 -12600
1050 -18900 79380 -117600 56700
-1400 26880 -117600 179200 -88200
630 -12600 56700 -88200 44100
A

A =

1 2 3
4 5 6
7 8 9

B=A+5

B =

6 7 8
9 10 11
12 13 14

A+B

ans =

7 9 11
13 15 17
19 21 23

A-B

ans =

-5 -5 -5
-5 -5 -5
-5 -5 -5

A*B

ans =

60 66 72
141 156 171
222 246 270

A.*B

ans =

6 14 24
36 50 66
84 104 126

A =

1 2 3
4 5 6
7 8 9

B
B =

6 7 8
9 10 11
12 13 14

A/B
[ Warning: Matrix is singular to working precision.]

ans =

NaN NaN NaN


NaN NaN NaN
NaN NaN NaN

C=A.^2

C =

1 4 9
16 25 36
49 64 81

A/C

ans =

-0.2500 0.3333 -0.0833


-0.0833 0.0000 0.0833
0.0833 -0.3333 0.2500

A./c
{ Undefined function or variable 'c'.
}
A./C

ans =

1.0000 0.5000 0.3333


0.2500 0.2000 0.1667
0.1429 0.1250 0.1111

A\C
[ Warning: Matrix is close to singular or badly scaled. Results may be
inaccurate. RCOND =
2.202823e-18.]

ans =

1.0e+17 *

0.5675 0.5675 0.5675


-1.1349 -1.1349 -1.1349
0.5675 0.5675 0.5675

A^2
ans =

30 36 42
66 81 96
102 126 150

A.^2

ans =

1 4 9
16 25 36
49 64 81

A'

ans =

1 4 7
2 5 8
3 6 9

A.'

ans =

1 4 7
2 5 8
3 6 9

A =

1 2 3
4 5 6
7 8 9

cond(A(
cond(A(

{ Error: Expression or statement is incorrect--possibly unbalanced (, {,


or [.
}
cond(A)

ans =

5.0523e+16

det(A)

ans =

-9.5162e-16

diad(X)
{ Undefined function or variable 'X'.
}
diag(x)

ans =

3 0 0 0 0 0
0 4 0 0 0 0
0 0 -5 0 0 0
0 0 0 2 0 0
0 0 0 0 8 0
0 0 0 0 0 8

diag(A)

ans =

1
5
9

A =

1 2 3
4 5 6
7 8 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 *

0.3153 -0.6305 0.3153


-0.6305 1.2610 -0.6305
0.3153 -0.6305 0.3153

lnegth(A)
{ Undefined function or variable 'lnegth'.
}
length(A)

ans =

3
norm(A)

ans =

16.8481

norm(A,3)
{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('nor
m')" style="font-weight:bold">norm</a>
The only matrix norms available are 1, 2, inf, and 'fro'.
}
norm(A,1)

ans =

18

norm(A,inf)

ans =

24

norm(A,fro)
{ Undefined function or variable 'fro'.
}
norm(A,'fro')

ans =

16.8819

norm(A)

ans =

16.8481

hel`p
hel`p

{ Error: The input character is not valid in MATLAB statements or


expressions.
}
help norm
<strong>norm</strong> Matrix or vector norm.
<strong>norm</strong>(X,2) returns the 2-norm of X.

<strong>norm</strong>(X) is the same as <strong>norm</strong>(X,2).

<strong>norm</strong>(X,1) returns the 1-norm of X.

<strong>norm</strong>(X,Inf) returns the infinity norm of X.

<strong>norm</strong>(X,'fro') returns the Frobenius norm of X.

In addition, for vectors...


<strong>norm</strong>(V,P) returns the p-norm of V defined as
SUM(ABS(V).^P)^(1/P).

<strong>norm</strong>(V,Inf) returns the largest element of ABS(V).

<strong>norm</strong>(V,-Inf) returns the smallest element of


ABS(V).

By convention, NaN is returned if X or V contains NaNs.

See also <a href="matlab:help cond">cond</a>, <a href="matlab:help


rcond">rcond</a>, <a href="matlab:help condest">condest</a>, <a
href="matlab:help normest">normest</a>, <a href="matlab:help
hypot">hypot</a>.

<a
href="matlab:matlab.internal.language.introspective.overloads.displayOver
loads('norm')">Other functions named norm</a>

normest(A)

ans =

16.8481

nunl(A)
{ Undefined function or variable 'nunl'.
}
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 =

-0.6389 -0.1667 0.3056


-0.0556 0.0000 0.0556
0.5278 0.1667 -0.1944

poly(A)

ans =

1.0000 -15.0000 -18.0000 -0.0000


rank(A)

ans =

size(A)

ans =

3 3

trace
{ Not enough input arguments.

Error in <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('tra
ce', 'E:\toolbox\matlab\matfun\trace.m', 11)" style="font-
weight:bold">trace</a> (<a href="matlab:
opentoline('E:\toolbox\matlab\matfun\trace.m',11,0)">line 11</a>)
if ~ismatrix(A) || size(A,1)~=size(A,2)
}
trace(A)

ans =

15

A =

1 2 3
4 5 6
7 8 9

tril(A)

ans =

1 0 0
4 5 0
7 8 9

triu(A)

ans =

1 2 3
0 5 6
0 0 9

cross(x,y)
{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('cro
ss', 'E:\toolbox\matlab\specfun\cross.m', 25)" style="font-
weight:bold">cross</a> (<a href="matlab:
opentoline('E:\toolbox\matlab\specfun\cross.m',25,0)">line 25</a>)
A and B must be of length 3 in the dimension in which the cross product
is taken.
}
dot(x,y)
{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('dot
', 'E:\toolbox\matlab\specfun\dot.m', 33)" style="font-
weight:bold">dot</a> (<a href="matlab:
opentoline('E:\toolbox\matlab\specfun\dot.m',33,0)">line 33</a>)
A and B must be same size.
}
Y
{ Undefined function or variable 'Y'.
}
y = [3 4 5]

y =

3 4 5

dot(x,y)
{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('dot
', 'E:\toolbox\matlab\specfun\dot.m', 33)" style="font-
weight:bold">dot</a> (<a href="matlab:
opentoline('E:\toolbox\matlab\specfun\dot.m',33,0)">line 33</a>)
A and B must be same size.
}
clc
diary off

You might also like