1 MATLAB desktop keyboard shortcuts, such as Command+S, are ...

19 downloads 27 Views 76KB Size Report
To customize keyboard shortcuts, use Preferences. From there, you can also ... Error using ==> vertcat. CAT arguments dimensions are not consistent.
1 MATLAB desktop keyboard shortcuts, such as Command+S, are now customizable. In addition, many keyboard shortcuts have changed for improved consistency across the desktop. To customize keyboard shortcuts, use Preferences. From there, you can also restore previous default settings by following the steps outlined in Help. Click here if you do not want to see this message again. >> i ans = 0 + 1.0000i >> j ans = 0 + 1.0000i >> x=7 x= 7 >> X ??? Undefined function or variable 'X'. >> x x= 7 >> x = 7^2 x= 49 >> pi ans = 3.1416

2 >> ans ans = 3.1416 >> i ans = 0 + 1.0000i >> ans ans = 0 + 1.0000i >> x=4 x= 4 >> x x= 4 >> x=2*x-2 x= 6 >> x=x/20; >> x x= 0.3000 >> clear x >> x ??? Undefined function or variable 'x'.

3 >> pi ans = 3.1416 >> clear pi >> pi ans = 3.1416 >> pi = 7 pi = 7 >> pi pi = 7 >> clear pi >> pi ans = 3.1416 >> whois ??? Undefined function or variable 'whois'. >> whos Name Size ans

1x1

Bytes Class

Attributes

8 double

>> whois ??? Undefined function or variable 'whois'. >> whos Name Size

Bytes Class

Attributes

4 ans

1x1

8 double

>> x=7 x= 7 >> whos Name Size ans x

Bytes Class

1x1 1x1

Attributes

8 double 8 double

>> whois ??? Undefined function or variable 'whois'. >> x = [1 2 3 2^2 2*3-1] x= 1

2

3

4

5

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

2 5

3 6

>> x = [1:5] x= 1

2

3

4

5

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

2 5

3 6

>> a = [1 2 3; 4 5] ??? Error using ==> vertcat CAT arguments dimensions are not consistent.

5 >> a = [0.5 : 0.75 ] a= 0.5000 >> a = [0.5 : 0.75] a= 0.5000 >> a = [0.5 : 3.75] a= 0.5000

1.5000

2.5000

3.5000

>> a = [0.5 :.1: 3.75] a= Columns 1 through 10 0.5000

0.6000

0.7000

0.8000

0.9000

1.0000

1.1000

1.2000

1.3000

1.4000

1.8000

1.9000

2.0000

2.1000

2.2000

2.3000

2.4000

2.8000

2.9000

3.0000

3.1000

3.2000

3.3000

3.4000

0.6500

0.7000

0.7500

0.8000

0.8500

0.9000

0.9500

Columns 11 through 20 1.5000

1.6000

1.7000

Columns 21 through 30 2.5000

2.6000

2.7000

Columns 31 through 33 3.5000

3.6000

3.7000

>> a = [0.5 :.05: 3.75] a= Columns 1 through 10 0.5000

0.5500

0.6000

6 Columns 11 through 20 1.0000

1.0500

1.1000

1.1500

1.2000

1.2500

1.3000

1.3500

1.4000

1.4500

1.6500

1.7000

1.7500

1.8000

1.8500

1.9000

1.9500

2.1500

2.2000

2.2500

2.3000

2.3500

2.4000

2.4500

2.6500

2.7000

2.7500

2.8000

2.8500

2.9000

2.9500

3.1500

3.2000

3.2500

3.3000

3.3500

3.4000

3.4500

3.6500

3.7000

3.7500

Columns 21 through 30 1.5000

1.5500

1.6000

Columns 31 through 40 2.0000

2.0500

2.1000

Columns 41 through 50 2.5000

2.5500

2.6000

Columns 51 through 60 3.0000

3.0500

3.1000

Columns 61 through 66 3.5000

3.5500

>> odd = [1:3:10] odd = 1

4

7

>> odd(3) ans = 7 >> odd(2:4) ans = 4

7

10

>> 10 + [1 2 3] ans = 11

12

13

10

3.6000

7 >> [1 2 3]+[4 5 6] ans = 5

7

9

>> [1 2 3].*[4 5 6] ans = 4

10

18

>> [1 2 3]*[4 5 6] ??? Error using ==> mtimes Inner matrix dimensions must agree. >> [1 2 3]*[4; 5; 6] ans = 32 >> mat1 = [1 2;3 4] mat1 = 1 3

2 4

>> mat2 = [mat1;mat1] mat2 = 1 3 1 3

2 4 2 4

>> [1 2 3]^2 ??? Error using ==> mpower Inputs must be a scalar and a square matrix. >> [1 2 3].^2 ans =

8 1

4

9

>> sqrt (-9) ans = 0 + 3.0000i >> sqrt (9) ans = 3 >> sqrt ([1 2 4 9]) ans = 1.0000

1.4142

2.0000

>> sin ([pi/4 pi/2 pi]) ans = 0.7071

1.0000

0.0000

>> 4*atan(1) ans = 3.1416 >> x x= 1

2

>> x=4 x= 4 >> log(x) ans =

3

4

5

3.0000

9 1.3863 >> log10(x) ans = 0.6021 >> cos(x) ans = -0.6536 >> atan(x) ans = 1.3258 >> exp(x) ans = 54.5982 >> x = 4.8 x= 4.8000 >> round(x) ans = 5 >> x=4.2 x= 4.2000 >> round(x)

10 ans = 4 >> x=-4.2 x= -4.2000 >> round(x) ans = -4 >> x = -4.8 x= -4.8000 >> round(x) ans = -5 >> x=4.3 x= 4.3000 >> floor(x) ans = 4 >> x=-4.3 x= -4.3000 >> floor(x)

11 ans = -5 >> x x= -4.3000 >> x=4.3 x= 4.3000 >> ceil(x) ans = 5 >> x=-4.3 x= -4.3000 >> ceil(x) ans = -4 >> angle(x) ans = 3.1416 >> x x= -4.3000

12 >> x=pi x= 3.1416 >> angle(x) ans = 0 >> x=pi/2 x= 1.5708 >> angle(x) ans = 0 >> x = 1 + i x= 1.0000 + 1.0000i >> angle(x) ans = 0.7854 >> angle(x)/2pi ??? angle(x)/2pi | Error: Unexpected MATLAB expression. >> angle(x)/(2*pi) ans = 0.1250

13 >> pi/4 ans = 0.7854 >> x=7 x= 7 >> abs(x) ans = 7 >> x=-7 x= -7 >> abs(x) ans = 7 >> help sin SIN Sine of argument in radians. SIN(X) is the sine of the elements of X. See also asin, sind. Reference page in Help browser doc sin >> help angle ANGLE Phase angle. ANGLE(H) returns the phase angles, in radians, of a matrix with complex elements. Class support for input X: float: double, single

14 See also abs, unwrap. Reference page in Help browser doc angle >> doc angle >> whos Name Size A 2x3 a 1x66 ans 1x1 mat1 2x2 mat2 4x2 odd 1x4 x 1x1

Bytes Class 48 double 528 double 8 double 32 double 64 double 32 double 8 double

>> save myfile mat1 mat2 >> load myfile >> whos Name Size Bytes Class A 2x3 a 1x66 ans 1x1 mat1 2x2 mat2 4x2 odd 1x4 x 1x1 >> mat1 mat1 = 1 3

2 4

>> mat1=9 mat1 = 9 >> load myfile >> mat1 mat1 =

Attributes

48 double 528 double 8 double 32 double 64 double 32 double 8 double

Attributes

15 1 3

2 4

>> x x= -7 >> x=[1:6] x= 1

2

3

4

5

6

>> transpose (x) ans = 1 2 3 4 5 6 >> x' ans = 1 2 3 4 5 6 >> x=[1+1i, 2+2i, 3+3i] x= 1.0000 + 1.0000i 2.0000 + 2.0000i 3.0000 + 3.0000i >> x' ans =

16 1.0000 - 1.0000i 2.0000 - 2.0000i 3.0000 - 3.0000i >> x.' ans = 1.0000 + 1.0000i 2.0000 + 2.0000i 3.0000 + 3.0000i >> scalarprod = [1 2 3 4] * [4 5 6 7]' scalarprod = 60 >> v1 = ones (1,10) v1 = 1

1

1

1

1

1

1

1

1

1

>> v1 = twos (1,10) ??? Undefined function or method 'twos' for input arguments of type 'double'. >> v1 = rand (1,10) v1 = 0.8147

0.9058

0.1270

0.9134

0.6324

0.0975

0.2785

0.5469

0.9575

0.9649

0.9572

0.4854

0.8003

0.1419

0.4218

0.9157

0.7922

0.9595

0.8491

0.9340

0.6787

0.7577

0.7431

0.3922

0.6555

0.1712

>> v1 = rand (1,10) v1 = 0.1576

0.9706

>> v1 = rand (1,10) v1 = 0.6557

0.0357

>> v1 = rand (1,10)

17 v1 = 0.7060

0.0318

0.2769

>> v1 = zeros (4,1) v1 = 0 0 0 0 >> a = [10 20 30 40] a= 10

20

30

40

>> b = a([1 2 4;3 4 2]) b= 10 30

20 40

40 20

>> c = b (1,:) c= 10

20

40

>> d = b (:,2) d= 20 40 >> b (:, 3) = [100 200] b= 10 30

20 100 40 200

0.0462

0.0971

0.8235

0.6948

0.3171

0.9502

0.0344

18 >> vec = [10 7 8 13 11 29] vec = 10

7

8

13

11

29

>> [minVal,minInd] = min(vec) minVal = 7 minInd = 2 >> min(vec) ans = 7 >> [maxVal,maxInd] = max(vec) maxVal = 29 maxInd = 6 >> max(vec) ans = 29 >> find(vec== 13) ans = 4 >> find(vec > 10 & vec < 20)

19 ans = 4 >>

5