Sei sulla pagina 1di 6

16/01/20 15:05 MATLAB Command Window 1 of 6

>> q=@(x) 4*x;


>> q(2)

ans =

>> diary('yesabella.txt')
>> %nombre_array=[elementos]
>> V=[1 2 3 4]

V =

1 2 3 4

>> V=[1,2,3,4]

V =

1 2 3 4

>> V=[1;2;3;4]

V =

1
2
3
4

>> V=[1,2,3,4]

V =

1 2 3 4

>> A=V'

A =

1
2
3
4

>> %transpuesta transposa


>> V=1:3

V =

1 2 3

>> V=1:4

V =
16/01/20 15:05 MATLAB Command Window 2 of 6

1 2 3 4

>> V=2:2:8

V =

2 4 6 8

>> B=1:2:11

B =

1 3 5 7 9 11

>> C=1:3:11

C =

1 4 7 10

>> D=linspace(0,8,6)

D =

0 1.6000 3.2000 4.8000 6.4000 8.0000

>> %linspace: Matlab decide la razon


>> E=linspace(30,10,11)

E =

30 28 26 24 22 20 18 16 14 12 10

>> F=[1 2 3 4 ;5 6 7 8]

F =

1 2 3 4
5 6 7 8

>> G=[1:2:9;5:5:25]

G =

1 3 5 7 9
5 10 15 20 25

>> N=zeros(2,3)

N =

0 0 0
0 0 0
16/01/20 15:05 MATLAB Command Window 3 of 6

>> U=ones(2,3)

U =

1 1 1
1 1 1

>> I=eye(7)

I =

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

>> I=eye(2,3)

I =

1 0 0
0 1 0

>> V(3)

ans =

>> V(3)=[]

V =

2 4 8

>> G(2,3)

ans =

15

>> G(6)

ans =

15

>> V=1:1:8

V =

1 2 3 4 5 6 7 8
16/01/20 15:05 MATLAB Command Window 4 of 6

>> V(2:5)

ans =

2 3 4 5

>> V(;)
V(;)

Error: Invalid expression. When calling a function or indexing a variable, use


parentheses. Otherwise, check for mismatched delimiters.

>> V(:)

ans =

1
2
3
4
5
6
7
8

>> A=[10:1:4;ones(1,7);2:2:14;zeros(1,7)]

A =

1 1 1 1 1 1 1
2 4 6 8 10 12 14
0 0 0 0 0 0 0

>> B=A[:,3]
B=A[:,3]

Error: Invalid expression. When calling a function or indexing a variable, use


parentheses. Otherwise, check for mismatched delimiters.

>> A=[10:-1:4;ones(1,7);2:2:14;zeros(1,7)]

A =

10 9 8 7 6 5 4
1 1 1 1 1 1 1
2 4 6 8 10 12 14
0 0 0 0 0 0 0

>> B=A[:,3]
B=A[:,3]

Error: Invalid expression. When calling a function or indexing a variable, use


parentheses. Otherwise, check for mismatched delimiters.
16/01/20 15:05 MATLAB Command Window 5 of 6

>> B=A(:,3)

B =

8
1
6
0

>> C=A(:,1:·3)
C=A(:,1:·3)

Error: Invalid text character. Check for unsupported symbol, invisible character, or
pasting of non-ASCII characters.

>> C=A(:,1:3)

C =

10 9 8
1 1 1
2 4 6
0 0 0

>> D=A(:,[1,3])

D =

10 8
1 1
2 6
0 0

>> E=A(1:3,:)

E =

10 9 8 7 6 5 4
1 1 1 1 1 1 1
2 4 6 8 10 12 14

>> E(4)=[]

E =

10 1 2 1 4 8 1 6 7 1 8 6 1 10
5 1 12 4 1 14

>> E(4)=[]

E =

10 1 2 4 8 1 6 7 1 8 6 1 10 5
1 12 4 1 14
16/01/20 15:05 MATLAB Command Window 6 of 6

>>

Potrebbero piacerti anche