Matlab#2
Matlab#2
Matlab # 2
>> x=-100:2:100
x=
Columns 1 through 6
Columns 7 through 12
Columns 13 through 18
Columns 19 through 24
Columns 25 through 30
Columns 31 through 36
Columns 37 through 42
Columns 43 through 48
Columns 49 through 54
-4 -2 0 2 4 6
Columns 55 through 60
8 10 12 14 16 18
Columns 61 through 66
20 22 24 26 28 30
Columns 67 through 72
32 34 36 38 40 42
Columns 73 through 78
44 46 48 50 52 54
Columns 79 through 84
56 58 60 62 64 66
Columns 85 through 90
68 70 72 74 76 78
Columns 91 through 96
80 82 84 86 88 90
92 94 96 98 100
>> magic(4)
ans =
16 2 3 13
5 11 10 8
9 7 6 12
4 14 15 1
>> det(magic(4))
ans =
>> size(magic(4))
ans =
4 4
Matlab # 3
x=2:0.01:5
>> y=3*x.^2
>> subplot(2,2,4)
>> plot(x,y)
>> z=exp(x)
>> subplot(2,2,3)
>> plot(x,z)
>> w=4+5*x
>> subplot(2,2,2)
>> plot(x,w)
>> v=log(x)
>> subplot(2,2,1)
>> plot(x,v)