
>>> date
ans = 26-Nov-2011
>>> 1+2
ans = 3
>>> 2/5
ans = 0.40000
>>> 1*4-2+3/2
ans = 3.5000
>>> 1*4^2-2^(3/2)
ans = 13.172
>>> 1:10
ans =
1 2 3 4 5 6 7 8 9 10
>>> 1:0.1:10
ans =
Columns 1 through 7:
1.0000 1.1000 1.2000 1.3000 1.4000 1.5000 1.6000
Columns 8 through 14:
1.7000 1.8000 1.9000 2.0000 2.1000 2.2000 2.3000
Columns 15 through 21:
2.4000 2.5000 2.6000 2.7000 2.8000 2.9000 3.0000
Columns 22 through 28:
3.1000 3.2000 3.3000 3.4000 3.5000 3.6000 3.7000
Columns 29 through 35:
3.8000 3.9000 4.0000 4.1000 4.2000 4.3000 4.4000
Columns 36 through 42:
4.5000 4.6000 4.7000 4.8000 4.9000 5.0000 5.1000
Columns 43 through 49:
5.2000 5.3000 5.4000 5.5000 5.6000 5.7000 5.8000
Columns 50 through 56:
5.9000 6.0000 6.1000 6.2000 6.3000 6.4000 6.5000
Columns 57 through 63:
6.6000 6.7000 6.8000 6.9000 7.0000 7.1000 7.2000
Columns 64 through 70:
7.3000 7.4000 7.5000 7.6000 7.7000 7.8000 7.9000
Columns 71 through 77:
8.0000 8.1000 8.2000 8.3000 8.4000 8.5000 8.6000
Columns 78 through 84:
8.7000 8.8000 8.9000 9.0000 9.1000 9.2000 9.3000
Columns 85 through 91:
9.4000 9.5000 9.6000 9.7000 9.8000 9.9000 10.0000
>>> matriks_A=[1 2;3 5]
matriks_A =
1 2
3 5
>>> 'x^2+3x+10'
ans = x^2+3x+10
>>> roots([1 3 10])
ans =
-1.5000 + 2.7839i
-1.5000 - 2.7839i
>>> 'x^5+3x^2+10'
ans = x^5+3x^2+10
>>> roots([1 0 0 3 10])
ans =
1.2683 + 1.4832i
1.2683 - 1.4832i
-1.2683 + 1.0086i
-1.2683 - 1.0086i
>>> roots([1 0 0 3 0 10])
ans =
-1.81927 + 0.00000i
1.21094 + 1.16345i
1.21094 - 1.16345i
-0.30130 + 1.36323i
-0.30130 - 1.36323i
>>> x=linspace(-5,5,200);
>>> y=x.^2+cos(x.^2);
>>> plot(x,y)
>>> x=linspace(-5,5,200);
>>> [X,Y]=meshgrid(x,x);
>>> Z=cos(X).*cos(Y/5);
>>> surf(X,Y,Z)
perhatikan bahwa tanda ; dibelakang akan mengabaikan tampilan...
silakan latihan dengan soal-soal berikut.

0 Komentar:
Post a Comment