Você está na página 1de 8

>> A

A =
2

>> A(1)~=0
ans =
1
>> A(1)==0
ans =
0
>> A(1)==2
ans =
1
>> A(1)>=0
ans =
1
>> U(1,2)>=0
ans =
0
>> U(1,2)<=0
ans =
1
>> U
U =
-1
5
-3
>> A/B

-5
5
0

ans =
1.8810
>> A./B
ans =

-3
-2
2

2.0000

2.0000

1.8000

>> A
A =
2

>> B
B =

>> mag(a)
??? Undefined function or variable 'a'.
>> F/G
ans =
-2.2857
5.1429
7.7143 -15.8571
-1.5714
5.2857

0.1429
2.1429
-0.7143

>> F./G
ans =
0.5000
6.0000
0

0.3750
2.2500
1.0000

0.6667
0.6000
1.3333

>> F
F =
1
6
0

3
9
5

6
3
8

>> G./F
ans =
2.0000
0.1667
Inf

2.6667
0.4444
1.0000

1.5000
1.6667
0.7500

>> G
G =
2
1
3

8
4
5

9
5
6

>> help det


DET
Determinant.
DET(X) is the determinant of the square matrix X.

Use COND instead of DET to test for matrix singularity.


See also cond.
Overloaded methods:
gf/det
sym/det
laurmat/det
Reference page in Help browser
doc det
>> help mag
mag not found.
Use the Help browser Search tab to search the documentation, or
type "help help" for help command options, such as help for methods.
>> help abs
ABS
Absolute value.
ABS(X) is the absolute value of the elements of X. When
X is complex, ABS(X) is the complex modulus (magnitude) of
the elements of X.
See also sign, angle, unwrap, hypot.
Overloaded methods:
frd/abs
codistributed/abs
iddata/abs
sym/abs
Reference page in Help browser
doc abs
>> abs(A)
ans =
2

>> det(A)
??? Error using ==> det
Matrix must be square.
>> det(U)
ans =
-35
>> U
U =
-1
5
-3

-5
5
0

-3
-2
2

>> U'
ans =
-1
-5
-3

5
5
-2

-3
0
2

>> inv(U)
ans =
-0.2857
0.1143
-0.4286

-0.2857
0.3143
-0.4286

-0.7143
0.4857
-0.5714

>> G
G =
2
1
3

8
4
5

9
5
6

>> lambda=G(2,1)/G(1,1)
lambda =
0.5000
>> G(2,:)=G(2,:)-lambda*G(1,:)
G =
2.0000
0
3.0000

8.0000
0
5.0000

9.0000
0.5000
6.0000

>> A=vander(1:0.2:2)
A =
1.0000
2.4883
5.3782
10.4858
18.8957
32.0000

1.0000
2.0736
3.8416
6.5536
10.4976
16.0000

1.0000
1.7280
2.7440
4.0960
5.8320
8.0000

1.0000
1.4400
1.9600
2.5600
3.2400
4.0000

1.0000
1.2000
1.4000
1.6000
1.8000
2.0000

1.0000
1.0000
1.0000
1.0000
1.0000
1.0000

0.0010
0.0021

0.0010
0.0019

0.0010
0.0018

0.0010
0.0016

>> B=vander(1:0.1:2)
B =
1.0e+003 *
Columns 1 through 6
0.0010
0.0026

0.0010
0.0024

0.0062
0.0138
0.0289
0.0577
0.1100
0.2016
0.3570
0.6131
1.0240

0.0052
0.0106
0.0207
0.0384
0.0687
0.1186
0.1984
0.3227
0.5120

0.0043
0.0082
0.0148
0.0256
0.0429
0.0698
0.1102
0.1698
0.2560

0.0036
0.0063
0.0105
0.0171
0.0268
0.0410
0.0612
0.0894
0.1280

0.0030
0.0048
0.0075
0.0114
0.0168
0.0241
0.0340
0.0470
0.0640

0.0010
0.0012
0.0014
0.0017
0.0020
0.0022
0.0026
0.0029
0.0032
0.0036
0.0040

0.0010
0.0011
0.0012
0.0013
0.0014
0.0015
0.0016
0.0017
0.0018
0.0019
0.0020

0.0010
0.0010
0.0010
0.0010
0.0010
0.0010
0.0010
0.0010
0.0010
0.0010
0.0010

1.0000
1.9487
3.5832
6.2749
10.5414
17.0859
26.8435
41.0339
61.2220
89.3872

1.0000
1.7716
2.9860
4.8268
7.5295
11.3906
16.7772
24.1376
34.0122
47.0459

1.0000
1.6105
2.4883
3.7129
5.3782
7.5938
10.4858
14.1986
18.8957
24.7610

1.0000
1.1000
1.2000
1.3000
1.4000
1.5000
1.6000
1.7000
1.8000
1.9000

1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000
1.0000

0.0025
0.0037
0.0054
0.0076
0.0105
0.0142
0.0189
0.0248
0.0320

Columns 7 through 11
0.0010
0.0015
0.0021
0.0029
0.0038
0.0051
0.0066
0.0084
0.0105
0.0130
0.0160

0.0010
0.0013
0.0017
0.0022
0.0027
0.0034
0.0041
0.0049
0.0058
0.0069
0.0080

>> B=vander(1:0.1:1.9)
B =
Columns 1 through 6
1.0000
1.0000
2.3579
2.1436
5.1598
4.2998
10.6045
8.1573
20.6610 14.7579
38.4434 25.6289
68.7195 42.9497
118.5879 69.7576
198.3593 110.1996
322.6877 169.8356

1.0000
1.4641
2.0736
2.8561
3.8416
5.0625
6.5536
8.3521
10.4976
13.0321

Columns 7 through 10
1.0000
1.3310
1.7280
2.1970
2.7440
3.3750
4.0960
4.9130
5.8320
6.8590
>> help
VANDER
A =
are

1.0000
1.2100
1.4400
1.6900
1.9600
2.2500
2.5600
2.8900
3.2400
3.6100

vander
Vandermonde matrix.
VANDER(V) returns the Vandermonde matrix whose columns
powers of the vector V, that is A(i,j) = v(i)^(n-j).

Class support for input V:

float: double, single


Reference page in Help browser
doc vander
>> A
A =
1.0000
2.4883
5.3782
10.4858
18.8957
32.0000

1.0000
2.0736
3.8416
6.5536
10.4976
16.0000

1.0000
1.7280
2.7440
4.0960
5.8320
8.0000

1.0000
1.4400
1.9600
2.5600
3.2400
4.0000

>> A=[4 -2 1;-2 4 -2;1 -2 4]


A =
4
-2
1

-2
4
-2

1
-2
4

>> b=[11 -16 17]


b =
11

-16

17

>> b=[11 -16 17]'


b =
11
-16
17
>> C=[A,b]
C =
4
-2
1

-2
4
-2

1
-2
4

11
-16
17

>> lambda1=C(2,1)/C(1,1)
lambda1 =
-0.5000
>> lambda1=C(2,1)/C(1,1);
>> C(2,:)=C(2,:)-lambda1*C(1,:)
C =
4.0000
0
1.0000

-2.0000
3.0000
-2.0000

1.0000 11.0000
-1.5000 -10.5000
4.0000 17.0000

1.0000
1.2000
1.4000
1.6000
1.8000
2.0000

1.0000
1.0000
1.0000
1.0000
1.0000
1.0000

>> lambda2=C(3,1)/C(1,1)
lambda2 =
0.2500
>> C(3,:)=C(3,:)-lambda2*C(1,:)
C =
4.0000
0
0

-2.0000
3.0000
-1.5000

1.0000 11.0000
-1.5000 -10.5000
3.7500 14.2500

>> lambda3=C(3,2)/C(2,2)
lambda3 =
-0.5000
>> C(3,:)=C(3,:)-lambda3*C(2,:)
C =
4.0000
0
0

-2.0000
3.0000
0

1.0000 11.0000
-1.5000 -10.5000
3.0000
9.0000

>> b=C(:,end)
b =
11.0000
-10.5000
9.0000
>> A=C(1:end,1:end-1)
A =
4.0000
0
0

-2.0000
3.0000
0

1.0000
-1.5000
3.0000

>> x=A\b
x =
1
-2
3
>> x=b/A
??? Error using ==> mrdivide
Matrix dimensions must agree.
>> inv(A)
ans =

0.2500
0
0
>> inv(A)*b
ans =
1
-2
3
>>

0.1667
0.3333
0

0
0.1667
0.3333

Você também pode gostar