You are on page 1of 4

MATLAB Command Window Page 1

>> 25+40/34-17

ans =

9.1765

>> 56+72-16/4*8+50

ans =

146

>> 34/6+186-57*12

ans =

-492.3333

>> 27^4*15+120-48

ans =

7971687

>> sqrt (65536+35-124/12)

ans =

256.0482

>> sqrt (175+256*12/8)

ans =

23.6432

>> 105+23-58*25-100/8

ans =

-1.3345e+03

>> sqrt (-1.3345e+03)

ans =

0.0000 +36.5308i

>> ans + 34/6+186-58*25-100/8

ans =

-1.2708e+03 + 3.6531e+01i

>> cos (pi/3)


MATLAB Command Window Page 2

ans =

0.5000

>> sin (pi/2) + cos (pi/3)

ans =

1.5000

>> tan (pi*4) + cos (pi*3)

ans =

-1.0000

>> sin (pi/4) + tan (pi/2) - cos (pi/2)

ans =

1.6331e+16

>> A = [6 9 7 8 11 9; 12 9 8 4 10 7; 6 14 9 6 9 6; 8 4 7 9 11 5; 4 12 9 6 8 10]

A =

6 9 7 8 11 9
12 9 8 4 10 7
6 14 9 6 9 6
8 4 7 9 11 5
4 12 9 6 8 10

>> A (4,5)

ans =

11

>> A (2,3)

ans =

>> A (3,:)

ans =

6 14 9 6 9 6

>> A (:,4)

ans =
MATLAB Command Window Page 3

8
4
6
9
6

>> E = zeros(9,7)

E =

0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 0 0 0 0

>> E = ones(10,6)

E =

1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1
1 1 1 1 1 1

>> z = 12:4:256

z =

Columns 1 through 13

12 16 20 24 28 32 36 40 44 48 52 56 60

Columns 14 through 26

64 68 72 76 80 84 88 92 96 100 104 108 112

Columns 27 through 39

116 120 124 128 132 136 140 144 148 152 156 160 164

Columns 40 through 52

168 172 176 180 184 188 192 196 200 204 208 212 216
MATLAB Command Window Page 4

Columns 53 through 62

220 224 228 232 236 240 244 248 252 256

>> z = 115:1,5:5

z =

Empty matrix: 1-by-0

ans =

>> linspace (3,7,11)

ans =

Columns 1 through 7

3.0000 3.4000 3.8000 4.2000 4.6000 5.0000 5.4000

Columns 8 through 11

5.8000 6.2000 6.6000 7.0000

>> linspace (-5,5,12)

ans =

Columns 1 through 7

-5.0000 -4.0909 -3.1818 -2.2727 -1.3636 -0.4545 0.4545

Columns 8 through 12

1.3636 2.2727 3.1818 4.0909 5.0000

>>

You might also like