Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
13
Добавлен:
22.02.2014
Размер:
29.7 Кб
Скачать

This is a Classroom License for instructional use only.

Research and commercial use is prohibited.

>> A=[6 -1 10 -1;2 1 10 7;3 -2 -2 -1;1 -12 2 -1]

A =

6 -1 10 -1

2 1 10 7

3 -2 -2 -1

1 -12 2 -1

>> B=[158 128 7 17]

B =

158 128 7 17

>> X=A\B

??? Error using ==> mldivide

Matrix dimensions must agree.

>> x=A/B

x =

0.0209

0.0152

0.0045

-0.0331

>> disp(B')

158

128

7

17

>> disp(B+3)

161 131 10 20

>> disp(B*3)

474 384 21 51

>> disp(B.^3)

3944312 2097152 343 4913

>> disp(A')

6 2 3 1

-1 1 -2 -12

10 10 -2 2

-1 7 -1 -1

>> disp(A^3)

410 130 380 -174

156 -60 -612 -798

86 148 128 72

-522 1272 -120 180

>> disp(inv(A))

0.0268 0.0361 0.2704 -0.0443

0.0245 -0.0105 -0.0140 -0.0839

0.0746 -0.0082 -0.1498 0.0181

-0.1177 0.1457 0.1387 -0.0012

>> disp(expm(A))

1.0e+003 *

3.5643 -0.0822 3.1916 -0.7782

1.2219 -0.0289 1.0937 -0.2671

0.8864 -0.0203 0.7938 -0.1936

-0.9896 0.0234 -0.8867 0.2155

>> disp(logm(A)

??? disp(logm(A)

|

Error: Expression or statement is incorrect--possibly

unbalanced (, {, or [.

>> disp(logm(A))

Warning: Principal matrix logarithm is not defined for A

with

nonpositive real eigenvalues. A non-principal

matrix

logarithm is returned.

> In funm at 161

In logm at 27

Columns 1 through 3

2.0011 + 0.7873i -0.0962 - 0.3311i 0.7490 - 2.4760i

-0.1111 + 0.1226i 2.5156 - 0.0516i 1.2473 - 0.3856i

0.2451 - 0.7063i -0.3392 + 0.2970i 1.5313 + 2.2212i

0.4225 + 0.6962i -1.8726 - 0.2928i 0.8397 - 2.1897i

Column 4

0.0847 + 0.2088i

1.1924 + 0.0325i

-0.0731 - 0.1873i

2.0929 + 0.1847i

>> disp(sqrtm(A))

Columns 1 through 3

2.2872 + 0.5019i -0.0583 - 0.2111i 2.4410 - 1.5785i

0.0578 + 0.0782i 2.5234 - 0.0329i 2.1144 - 0.2458i

0.7361 - 0.4502i -0.5735 + 0.1893i 0.6324 + 1.4160i

0.1969 + 0.4439i -2.5794 - 0.1867i 1.6477 - 1.3960i

Column 4

-0.0999 + 0.1331i

1.6351 + 0.0207i

-0.0899 - 0.1194i

1.9029 + 0.1177i

>> x=[6 -1 10 -1;2 1 10 7;3 -2 -2 -1;1 -12 2 -1]

x =

6 -1 10 -1

2 1 10 7

3 -2 -2 -1

1 -12 2 -1

>> disp(cond(x))

5.8309

>> disp(norm(x,1))

24

>> disp(norm(x,2))

16.0776

>> disp(rcond(x))

0.0727

>> disp(rank(x))

4

>> disp((det(x)))

-3432

>> disp(trace(x))

4

>> disp(null(x))

>> disp(orth(x))

-0.6771 -0.0173 0.7032 0.2162

-0.6896 0.3420 -0.5631 -0.3007

0.0378 -0.2172 0.3149 -0.9232

-0.2541 -0.9141 -0.2988 0.1027

>> disp(rref(x))

1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

>> p=[-1 -3 -6 0 -7 -8 6]

p =

-1 -3 -6 0 -7 -8 6

>> p=[1 -1 1 -11 10]

p =

1 -1 1 -11 10

>> r=(roots(P))

??? Undefined function or variable 'P'.

>> r=(roots(p))

r =

-1.0000 + 2.0000i

-1.0000 - 2.0000i

2.0000

1.0000

>> disp(poly(r))

1.0000 -1.0000 1.0000 -11.0000 10.0000

>> disp(polyval(p,3))

40

>> disp(polyder(p))

4 -3 2 -11

>> x=0:0.1:10;

>> y=sqrt(1-0.4*x(sqr.^2))-arcsin(x);

??? Undefined function or variable 'sqr'.

>> y=sqrt(1-0.4*x.^2)-arcsin(x);

??? Undefined function or method 'arcsin' for input

arguments of type 'double'.

>> y=sqrt(1-0.4*(sqr(x))-arcsin(x);

??? y=sqrt(1-0.4*(sqr(x))-arcsin(x);

|

Error: Unbalanced or unexpected parenthesis or bracket.

>> y=sqrt(1-0.4*x^2)-arcsin(x);

??? Error using ==> mpower

Matrix must be square.

>> y=sqrt(1-0.4*(sqr(x))-arcsin(x);

??? y=sqrt(1-0.4*(sqr(x))-arcsin(x);

|

Error: Unbalanced or unexpected parenthesis or bracket.

>> y=sqrt(1-0.4*(sqr(x)))-arcsin(x);

??? Undefined function or method 'sqr' for input arguments

of type 'double'.

>> y=sqrt(1-0.4*(sqr(x)))-arcsin(x)

??? Undefined function or method 'sqr' for input arguments

of type 'double'.

>>