Sie sind auf Seite 1von 21

>> x={1,2,3}

x=

[1] [2] [3]

>> x={1 2 3}

x=

[1] [2] [3]

>> y={1;2;3}

y=

[1]

[2]

[3]

>> d=[1:10]

d=

1 2 3 4 5 6 7 8 9 10

>> d=1:10

d=

1 2 3 4 5 6 7 8 9 10

>> d=[1:0.5:4]

d=

Columns 1 through 6

1.0000 1.5000 2.0000 2.5000 3.0000 3.5000

Column 7

4.0000

>> g=linspace(1,9,5)

g=

1 3 5 7 9

>> g=linspace(1,9,15)
g=

Columns 1 through 6

1.0000 1.5714 2.1429 2.7143 3.2857 3.8571

Columns 7 through 12

4.4286 5.0000 5.5714 6.1429 6.7143 7.2857

Columns 13 through 15

7.8571 8.4286 9.0000

> zeros(3)

ans =

0 0 0

0 0 0

0 0 0

>> zeeros(2,5)

Undefined function or variable 'zeeros'.

Did you mean:

>> zeros(2,5)

ans =

0 0 0 0 0

0 0 0 0 0

>> ones(2,5)

ans =

1 1 1 1 1

1 1 1 1 1

>> ones(4,2)

ans =

1 1
1 1

1 1

1 1

>> eyes(4)

Undefined function or variable 'eyes'.

Did you mean:

>> eye(4)

ans =

1 0 0 0

0 1 0 0

0 0 1 0

0 0 0 1

>> eye(4,2)

ans =

1 0

0 1

0 0

0 0

>> eye(3,5)

ans =

1 0 0 0 0

0 1 0 0 0

0 0 1 0 0

>> rand(2,4)

ans =

0.8147 0.1270 0.6324 0.2785

0.9058 0.9134 0.0975 0.5469


>> rand(4)

ans =

0.9575 0.9572 0.4218 0.6557

0.9649 0.4854 0.9157 0.0357

0.1576 0.8003 0.7922 0.8491

0.9706 0.1419 0.9595 0.9340

>> 10*rand(4)

ans =

6.7874 6.5548 2.7692 6.9483

7.5774 1.7119 0.4617 3.1710

7.4313 7.0605 0.9713 9.5022

3.9223 0.3183 8.2346 0.3445

>> round(10*rand(4))

ans =

4 2 7 7

4 5 8 2

8 4 3 1

8 6 7 5

>> M=round(10*rand(4))

M=

10 8 9 1

3 3 10 3

6 5 5 8

2 7 1 3

>> M

M=

10 8 9 1
3 3 10 3

6 5 5 8

2 7 1 3

>>

>> y=[1 4 9];

>> DOT(X,y)

Cannot find an exact (case-sensitive) match for 'DOT'

The closest match is: dot in C:\Program Files\MATLAB\MATLAB

Production Server\R2015a\toolbox\matlab\specfun\dot.m

Did you mean:

>> dot(X,y)

ans =

36

>> cross(X,y)

ans =

6 -6 2

>> X*y

Error using *

Inner matrix dimensions must agree.

>> X*y`

X*y`

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

expressions.
>> X*y

X*y

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

expressions.

>> X*y'

ans =

36

>> norm(y,1)

ans =

14

>> norma(y,2)

Undefined function or variable 'norma'.

Did you mean:

>> norm(y,2)

ans =

9.8995

>> N=[1-x 2 3;4 5-x 6;7 8 9-x]

Undefined function or variable 'x'.

>> syms x

>> N=[1-x 2 3;4 5-x 6;7 8 9-x];

>> N

N=

[ 1 - x, 2, 3]

[ 4, 5 - x, 6]

[ 7, 8, 9 - x]
>> M1=rand(3)

M1 =

0.8143 0.3500 0.6160

0.2435 0.1966 0.4733

0.9293 0.2511 0.3517

>> det[M1]

det[M1]

Error: Unbalanced or unexpected parenthesis or bracket.

>> det(M1)

ans =

0.0086

>> det(N)

ans =

- x^3 + 15*x^2 + 18*x

>> p=[-1,15,18,0]

p=

-1 15 18 0

>> roots(p)

ans =

16.1168

-1.1168

>> OPERADORES Y EJECICICSOC

>> A=[1 2 -2; 0 -1 7;-3 0 5];B=[6 -1 0;2 -1 1;4 0 0];C=[9 3;5 2;-8 -1]

C=
9 3

5 2

-8 -1

>> (A+2*B)*C

ans =

133 41

-51 -3

5 10

>> A^2-B

ans =

1 1 2

-23 2 27

-22 -6 31

>> round((rand(4,6)-rand(4,6))*100)

ans =

23 -46 -35 -22 -49 -7

32 31 -8 86 1 23

-10 67 -77 -31 -44 13

23 15 -1 46 -66 -9

>> round((rand(4,6)*200-100)

round((rand(4,6)*200-100)

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

{, or [.

Did you mean:

>> round((rand(4,6)*200-100))
ans =

60 -47 16 24 -85 -52

-14 -71 10 -30 -52 -17

82 -73 -71 3 -75 -90

-64 74 71 -20 -63 81

>>

DSVFGRWAGVRZAGWRA

>> A=[6 8 6 5 7 8;1 0 7 3 2 1;2 0 6 7 4 9;4 2 5 2 6 8]; B=[3 2;1 0]; C=[1 0 5 6;0 0 0 1];

>> M=2*ones(3)-3*eye(3)

M=

-1 2 2

2 -1 2

2 2 -1

>> D=[(B;C'),(A(3,3);M)]

D=[(B;C'),(A(3,3);M)]

Error: Unbalanced or unexpected parenthesis or bracket.

>> D=[(B;C'),(A;M)]

D=[(B;C'),(A;M)]

Error: Unbalanced or unexpected parenthesis or bracket.

>> D=[B;C'][A(1:3,4:end);M]

D=[B;C'][A(1:3,4:end);M]

Error: Unbalanced or unexpected parenthesis or bracket.


>> D=[B;C']+[A(1:3,4:end);M]

Error using +

Matrix dimensions must agree.

>> D=[B;C']

D=

3 2

1 0

1 0

0 0

5 0

6 1

>> D1=[A(1:3,4:end);M]

D1 =

5 7 8

3 2 1

7 4 9

-1 2 2

2 -1 2

2 2 -1

>> [D D1]

ans =

3 2 5 7 8

1 0 3 2 1

1 0 7 4 9

0 0 -1 2 2

5 0 2 -1 2
6 1 2 2 -1

>> P=[[B;C'][A(1:3,4:end);M]]

P=[[B;C'][A(1:3,4:end);M]]

Error: Unbalanced or unexpected parenthesis or bracket.

>> [B;C'][A(1:3,4:end);M]

[B;C'][A(1:3,4:end);M]

Error: Unbalanced or unexpected parenthesis or bracket.

>>KJNDSOVFNAWNCEWANC

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

>> X=[A*,eye(3)]

X=[A*,eye(3)]

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

{, or [.

>> X=[A,eye(3)]

X=

3 2 1 1 0 0

5 3 4 0 1 0

1 1 -1 0 0 1

>> X(1;:)=X(1;:)-2*X(3;:)

X(1;:)=X(1;:)-2*X(3;:)

|
Error: Unbalanced or unexpected parenthesis or bracket.

>> X(1:)=X(1,:)-2*X(3,:)

X(1:)=X(1,:)-2*X(3,:)

Error: Unbalanced or unexpected parenthesis or bracket.

>> X(1,:)=X(1,:)-2*X(3,:)

X=

1 0 3 1 0 -2

5 3 4 0 1 0

1 1 -1 0 0 1

>> X(2,:)=X(2,:)-5*X(3,:)

X=

1 0 3 1 0 -2

0 -2 9 0 1 -5

1 1 -1 0 0 1

>> X(3,:)=X(3,:)-X(1,:)

X=

1 0 3 1 0 -2

0 -2 9 0 1 -5

0 1 -4 -1 0 3

>> X(2,:)=X(2,:)+3*X(3,:)

X=

1 0 3 1 0 -2

0 1 -3 -3 1 4

0 1 -4 -1 0 3
>> X(3,:)=X(3,:)-X(2,:)

X=

1 0 3 1 0 -2

0 1 -3 -3 1 4

0 0 -1 2 -1 -1

>> X(1,:)=X(1,:)+3*X(3,0)

Attempted to access X(3,0); index must be a positive integer or

logical.

>> X(1,:)=X(1,:)+3*X(3,:)

X=

1 0 0 7 -3 -5

0 1 -3 -3 1 4

0 0 -1 2 -1 -1

>> X(2,:)=X(2,:)-3*(3;:)

X(2,:)=X(2,:)-3*(3;:)

Error: Unbalanced or unexpected parenthesis or bracket.

>> X(2,:)=X(2,:)-3*(3,:)

X(2,:)=X(2,:)-3*(3,:)

Error: Expression or statement is incorrect--possibly unbalanced

(, {, or [.

>> X(2,:)=X(2,:)-3*X(3,:)

X=

1 0 0 7 -3 -5
0 1 0 -9 4 7

0 0 -1 2 -1 -1

>> X(3;:)=X(3;:)*(-1)

X(3;:)=X(3;:)*(-1)

Error: Unbalanced or unexpected parenthesis or bracket.

>> X(3,:)=X(3,:)*(-1)

X=

1 0 0 7 -3 -5

0 1 0 -9 4 7

0 0 1 -2 1 1

>>

CLASE DE CONFORMADO PRACTICA 2

>> x=linspace(1,10,5)

x=

1.0000 3.2500 5.5000 7.7500 10.0000

>> B1=log(x)

B1 =

0 1.1787 1.7047 2.0477 2.3026

>> B1'

ans =

1.1787

1.7047

2.0477

2.3026
>> B1=log(x)

B1 =

0 1.1787 1.7047 2.0477 2.3026

>> B2=sin(x)

B2 =

0.8415 -0.1082 -0.7055 0.9946 -0.5440

>> B3=sin(x^2)

Error using ^

Inputs must be a scalar and a square matrix.

To compute elementwise POWER, use POWER (.^) instead.

>> B3=sin(x.^2)

B3 =

0.8415 -0.9077 -0.9192 -0.3637 -0.5064

>> B4=x(sin(x))^3

Subscript indices must either be real positive integers or

logicals.

>> B4=x.*(sin(x))^3

Error using ^

Inputs must be a scalar and a square matrix.

To compute elementwise POWER, use POWER (.^) instead.

>> B4=x.*(sin(x.))^3

B4=x.*(sin(x.))^3

Error: Unbalanced or unexpected parenthesis or bracket.

>> B4=x.*sin(x.)^3

B4=x.*sin(x.)^3
|

Error: Unbalanced or unexpected parenthesis or bracket.

>> B4=x*sin(x.)^3

B4=x*sin(x.)^3

Error: Unbalanced or unexpected parenthesis or bracket.

>>

>> B4=x*(sin(x))^3.

Error using ^

Inputs must be a scalar and a square matrix.

To compute elementwise POWER, use POWER (.^) instead.

>> B4=x.*(sin(x)).^3

B4 =

0.5958 -0.0041 -1.9316 7.6251 -1.6101

>> sem2

x=

1.0000 3.2500 5.5000 7.7500 10.0000

B1 =

0 1.1787 1.7047 2.0477 2.3026

B2 =

0.8415 -0.1082 -0.7055 0.9946 -0.5440

B3 =

0.8415 -0.9077 -0.9192 -0.3637 -0.5064

B4 =

0.5958 -0.0041 -1.9316 7.6251 -1.6101


>> sem2

x=

1.0000 3.2500 5.5000 7.7500 10.0000

B1 =

0 1.1787 1.7047 2.0477 2.3026

B2 =

0.8415 -0.1082 -0.7055 0.9946 -0.5440

B3 =

0.8415 -0.9077 -0.9192 -0.3637 -0.5064

B4 =

0.5958 -0.0041 -1.9316 7.6251 -1.6101

>> sem2

x=

1.0000 3.2500 5.5000 7.7500 10.0000

B1 =

0 1.1787 1.7047 2.0477 2.3026

B2 =

0.8415 -0.1082 -0.7055 0.9946 -0.5440

B3 =

0.8415 -0.9077 -0.9192 -0.3637 -0.5064

B4 =

0.5958 -0.0041 -1.9316 7.6251 -1.6101

>> sem2

x=

1.0000 3.2500 5.5000 7.7500 10.0000

B1 =

0 1.1787 1.7047 2.0477 2.3026


B2 =

0.8415 -0.1082 -0.7055 0.9946 -0.5440

B3 =

0.8415 -0.9077 -0.9192 -0.3637 -0.5064

B4 =

0.5958 -0.0041 -1.9316 7.6251 -1.6101

>> sem2

x=

1.0000 3.2500 5.5000 7.7500 10.0000

B1 =

0 1.1787 1.7047 2.0477 2.3026

B2 =

0.8415 -0.1082 -0.7055 0.9946 -0.5440

B3 =

0.8415 -0.9077 -0.9192 -0.3637 -0.5064

B4 =

0.5958 -0.0041 -1.9316 7.6251 -1.6101

>> sem2

x=

1.0000 3.2500 5.5000 7.7500 10.0000

B1 =

0 1.1787 1.7047 2.0477 2.3026

B2 =

0.8415 -0.1082 -0.7055 0.9946 -0.5440

B3 =

0.8415 -0.9077 -0.9192 -0.3637 -0.5064

B4 =
0.5958 -0.0041 -1.9316 7.6251 -1.6101

>> sem2

x=

1.0000 3.2500 5.5000 7.7500 10.0000

B1 =

0 1.1787 1.7047 2.0477 2.3026

B2 =

0.8415 -0.1082 -0.7055 0.9946 -0.5440

B3 =

0.8415 -0.9077 -0.9192 -0.3637 -0.5064

B4 =

0.5958 -0.0041 -1.9316 7.6251 -1.6101

>> sem2

x=

1.0000 3.2500 5.5000 7.7500 10.0000

B1 =

0 1.1787 1.7047 2.0477 2.3026

B2 =

0.8415 -0.1082 -0.7055 0.9946 -0.5440

B3 =

0.8415 -0.9077 -0.9192 -0.3637 -0.5064

B4 =

0.5958 -0.0041 -1.9316 7.6251 -1.6101

>> sem2

x=

1.0000 3.2500 5.5000 7.7500 10.0000

B1 =
0 1.1787 1.7047 2.0477 2.3026

B2 =

0.8415 -0.1082 -0.7055 0.9946 -0.5440

B3 =

0.8415 -0.9077 -0.9192 -0.3637 -0.5064

B4 =

0.5958 -0.0041 -1.9316 7.6251 -1.6101

>> sem2

x=

1.0000 3.2500 5.5000 7.7500 10.0000

B1 =

0 1.1787 1.7047 2.0477 2.3026

B2 =

0.8415 -0.1082 -0.7055 0.9946 -0.5440

B3 =

0.8415 -0.9077 -0.9192 -0.3637 -0.5064

B4 =

0.5958 -0.0041 -1.9316 7.6251 -1.6101

>> sem2

x=

1.0000 3.2500 5.5000 7.7500 10.0000

B1 =

0 1.1787 1.7047 2.0477 2.3026

B2 =

0.8415 -0.1082 -0.7055 0.9946 -0.5440

B3 =

0.8415 -0.9077 -0.9192 -0.3637 -0.5064


B4 =

0.5958 -0.0041 -1.9316 7.6251 -1.6101

>>

Das könnte Ihnen auch gefallen