Você está na página 1de 24

Viracucha Mosquera Dennis Alexander

{ Undefined function or variable 'Viracucha'.


}
Metodos Numericos
{ Undefined function or variable 'Metodos'.
}
methods Numericos 2539
{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('met
hods')" style="font-weight:bold">methods</a>
Unknown command option.
}
metodos numericos 2539
{ Undefined function or variable 'metodos'.
}
date

ans =

'29-Mar-2019'

clc
a=5

a =

b=7

b =

b=7;
a+5

ans =

10

a-b

ans =

-2

a*b

ans =

35

a/b
ans =

0.7143

a^b

ans =

78125

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

pi

ans =

3.1416

format long
pi

ans =

3.141592653589793

format short
pi

ans =

3.1416

format short
format short e
pi

ans =

3.1416e+00

format long e
pi
ans =

3.141592653589793e+00

format short g
pi

ans =

3.1416

format long g
pi

ans =

3.14159265358979

format short eng


pi

ans =

3.1416e+000

format long eng


pi

ans =

3.14159265358979e+000

format bank
pi

ans =

3.14

format hex
pi

ans =

400921fb54442d18

format rat
pi

ans =

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

ans =

-pi

ans =

ans =

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

ans =

Inf

30/0

ans =

Inf

nan

ans =

NaN

5+3j

ans =
5.0000 + 3.0000i

5+3i

ans =

5.0000 + 3.0000i

whos
Name Size Bytes Class Attributes

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

clc
realmin

ans =

2.2251e-308

realmax

ans =

1.7977e+308

clock

ans =

1.0e+03 *

2.0190 0.0030 0.0290 0.0120 0.0440 0.0009

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

ans =

fix(pi)

ans =
3

floor(pi)

ans =

round(pi)

ans =

clc
sin(pi)

ans =

1.2246e-16

sind(180)

ans =

cos(pi)

ans =

-1

tan(pi)

ans =

-1.2246e-16

tand(pi)

ans =

0.0549

tand(180)

ans =

csc(pi)

ans =
8.1656e+15

cot(pi)

ans =

-8.1656e+15

sec(pi)

ans =

-1

secd(pi)

ans =

1.0015

tanh(pi)

ans =

0.9963

asin(1)

ans =

1.5708

acosh(1)

ans =

abs(-15)

ans =

15

sign(ans)

ans =

sign(-14)

ans =
-1

sign(0)

ans =

exp(1)

ans =

2.7183

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

Error in <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('gcd
', 'C:\Program Files\MATLAB\R2017b\toolbox\matlab\specfun\gcd.m', 25)"
style="font-weight:bold">gcd</a> (<a href="matlab: opentoline('C:\Program
Files\MATLAB\R2017b\toolbox\matlab\specfun\gcd.m',25,0)">line 25</a>)
if ~isequal(size(a),size(b)) && ~isscalar(a) && ~isscalar(b)
}
gcd(9,12)

ans =

lcm(9,12)

ans =

36

log(10)

ans =

2.3026

log2(10)

ans =

3.3219
log10(10)

ans =

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

ans =

mod(12,7)

ans =

mod(-12,5)

ans =

mod(12,5)

ans =

help mod
<strong>mod</strong> Modulus after division.
<strong>mod</strong>(x,y) returns x - floor(x./y).*y if y ~= 0,
carefully computed to
avoid rounding error. If y is not an integer and the quotient x./y is
within roundoff error of an integer, then n is that integer. The
inputs
x and y must be real and have compatible sizes. In the simplest
cases,
they can be the same size or one can be a scalar. Two inputs have
compatible sizes if, for every dimension, the dimension sizes of the
inputs are either the same or one of them is 1.

The statement "x and y are congruent mod m" means mod(x,m) ==
mod(y,m).

By convention:
<strong>mod</strong>(x,0) is x.
<strong>mod</strong>(x,x) is 0.
<strong>mod</strong>(x,y), for x~=y and y~=0, has the same sign as
y.

Note: REM(x,y), for x~=y and y~=0, has the same sign as x.
<strong>mod</strong>(x,y) and REM(x,y) are equal if x and y have the
same sign, but
differ by y if x and y have different signs.

See also <a href="matlab:help rem">rem</a>.

<a href="matlab:doc mod">Reference page for mod</a>


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

rem(12,5)

ans =

rem(-12,5)

ans =

-2

sqrt(100)

ans =

10

nthroot(27,3)

ans =

nthroot(27,5)

ans =

1.9332

clc
x=3+4j

x =

3.0000 + 4.0000i
y=3

y =

z=5

z =

x =

3.0000 + 4.0000i

abs(x)

ans =

angle(x)

ans =

0.9273

angled(x)
{ Undefined function or variable 'angled'.
}
angle(x)

ans =

0.9273

complex(3,7)

ans =

3.0000 + 7.0000i

complex(3,-7)

ans =

3.0000 - 7.0000i

conj(ans)
ans =

3.0000 + 7.0000i

imag(x)

ans =

x =

3.0000 + 4.0000i

real(x)

ans =

sign(x)

ans =

0.6000 + 0.8000i

isreal(x)

ans =

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

isreal(y)

ans =

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

x=[1,7,-3 4 6]

x =

1 7 -3 4 6

y=x+2

y =
3 9 -1 6 8

z=x+y

z =

4 16 -4 10 14

x =

1 7 -3 4 6

x(2)

ans =

x(end)

ans =

x =

1 7 -3 4 6

x(1:2:5)

ans =

1 -3 6

x =

1 7 -3 4 6

x([3 5 4])

ans =

-3 6 4

x =
1 7 -3 4 6

x(2:4)

ans =

7 -3 4

A=[1 2 3;4 5 6]

A =

1 2 3
4 5 6

A(2,1)

ans =

A =

1 2 3
4 5 6

A(2)

ans =

A(2,:)

ans =

4 5 6

A(:,2)

ans =

2
5

A(2,2:3)

ans =

5 6

A(2,[¨3 1])
A(2,[¨3 1])

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


expressions.
}
A(2,[3 1])

ans =

6 4

A([2 1],2:3)

ans =

5 6
2 3

A(end,[1 3])

ans =

4 6

A =

1 2 3
4 5 6

zeros(3)

ans =

0 0 0
0 0 0
0 0 0

zeros(3,2)

ans =

0 0
0 0
0 0

ones(3)

ans =

1 1 1
1 1 1
1 1 1
ones(3,2)

ans =

1 1
1 1
1 1

rand(5)

ans =

0.8147 0.0975 0.1576 0.1419 0.6557


0.9058 0.2785 0.9706 0.4218 0.0357
0.1270 0.5469 0.9572 0.9157 0.8491
0.9134 0.9575 0.4854 0.7922 0.9340
0.6324 0.9649 0.8003 0.9595 0.6787

rand(3,2)

ans =

0.7577 0.6555
0.7431 0.1712
0.3922 0.7060

randn(4)

ans =

-1.1471 1.4384 -1.7115 0.3129


-1.0689 0.3252 -0.1022 -0.8649
-0.8095 -0.7549 -0.2414 -0.0301
-2.9443 1.3703 0.3192 -0.1649

randn(3,2)

ans =

0.6277 -0.8637
1.0933 0.0774
1.1093 -1.2141

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,3)

ans =

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

hilb(4)

ans =

1.0000 0.5000 0.3333 0.2500


0.5000 0.3333 0.2500 0.2000
0.3333 0.2500 0.2000 0.1667
0.2500 0.2000 0.1667 0.1429

invhilb(4)

ans =

16 -120 240 -140


-120 1200 -2700 1680
240 -2700 6480 -4200
-140 1680 -4200 2800

A =

1 2 3
4 5 6

B=A+1

B =

2 3 4
5 6 7

A+B

ans =

3 5 7
9 11 13

A-B

ans =
-1 -1 -1
-1 -1 -1

A*B
{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('mti
mes')" style="font-weight:bold"> * </a>
Inner matrix dimensions must agree.
}
A*.B
A*.B

{ Error: Unexpected MATLAB operator.


}
A.*B

ans =

2 6 12
20 30 42

A*B'

ans =

20 38
47 92

A =

1 2 3
4 5 6

A'

ans =

1 4
2 5
3 6

A.'

ans =

1 4
2 5
3 6

A/B

ans =
1.3333 -0.3333
0.3333 0.6667

A./B

ans =

0.5000 0.6667 0.7500


0.8000 0.8333 0.8571

A.\B

ans =

2.0000 1.5000 1.3333


1.2500 1.2000 1.1667

A\B

ans =

0.5000 0.0000 -0.5000


0 0 0
0.5000 1.0000 1.5000

A^2
{ Error using <a
href="matlab:matlab.internal.language.introspective.errorDocCallback('mpo
wer')" style="font-weight:bold"> ^ </a>
One argument must be a square matrix and the other must be a scalar. Use
POWER (.^) for elementwise power.
}
A.^2

ans =

1 4 9
16 25 36

x=[1 2 3]

x =

1 2 3

y=x+2

y =

3 4 5

cross(x,y)
ans =

-2 4 -2

dot(x,y)

ans =

26

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

A =

1 2 3
4 5 6
7 8 9

cond(A)

ans =

5.0523e+16

det(A)

ans =

-9.5162e-16

diag(x)

ans =

1 0 0
0 2 0
0 0 3

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 *

0.3153 -0.6305 0.3153


-0.6305 1.2610 -0.6305
0.3153 -0.6305 0.3153

length(B)

ans =

norm(A)

ans =

16.8481

norm(A,n)
{ Undefined function or variable 'n'.
}
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:doc norm">Reference page for norm</a>


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

norm(A,'fro')

ans =

16.8819

norm(A,2)

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)

ans =

16.8481

null(A)

ans =

-0.4082
0.8165
-0.4082

A
A =

1 2 3
4 5 6
7 8 9

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

pinv(B)

ans =

-1.1111 0.6111
-0.1111 0.1111
0.8889 -0.3889

poly(A)

ans =

1.0000 -15.0000 -18.0000 -0.0000

rank(A)

ans =

size(A)

ans =

3 3

trace(A)

ans =

15
tril(A)

ans =

1 0 0
4 5 0
7 8 9

tril(B)

ans =

2 0 0
5 6 0

triu(A)

ans =

1 2 3
0 5 6
0 0 9

diary off

Você também pode gostar