Anda di halaman 1dari 5

No.

No.2

%Pecahkanlah persamaan linier tiga


variabel berikut ini:
%x + 2y 3z = 2
%4x + 5y + 6z = -5,5
%7x + 8y - 9z = -49

%Carilah solusi dari persamaan


lingkaran berikut ini:
%y = (25+x.^2).^0.5 untuk -10<x<5 ,
dengan inkremen x sebesar 0,05.
%Setelah itu, tampilkanlah nilai y
pada rentang x = 0 hingga x = 1
saja.

%jawab:
%membuat matriks A
A=[1 2 -3;4 5 6;7 8 -9];
%membuat matriks B
B=[2;-5.5;-49];
%menghitung x cara ke-1
x=inv(A)*[B]
%menghitung x cara ke-2
x=A^-1*B
%menghitung x cara ke-3
x=A\B

x=
-20.5000
13.5000
1.5000
x=
-20.5000
13.5000
1.5000
x=
-20.5000
13.5000
1.5000

%jawab:
%membuat vektor x
x=[-10:0.05:5]';
%menghitung y
y=(25-x.^2).^0.5;
%menghitung panjang vektor x
panjang=length(x);
titik_tengah=round(panjang/2);
%menentukan indeks untuk x=0 hingga
x=1
awal=titik_tengah+2.5/0.05;
akhir=awal+1/0.05;
%menampilkan nilai y pada rentang
x=0 hingga x=1 saja
[x(awal:akhir),y(awal:akhir)]

ans =
0
0.0500
0.1000
0.1500
0.2000
0.2500
0.3000
0.3500
0.4000
0.4500
0.5000
0.5500
0.6000
0.6500
0.7000
0.7500
0.8000
0.8500
0.9000
0.9500
1.0000

5.0000
4.9997
4.9990
4.9977
4.9960
4.9937
4.9910
4.9877
4.9840
4.9797
4.9749
4.9697
4.9639
4.9576
4.9508
4.9434
4.9356
4.9272
4.9183
4.9089
4.8990

%Buatlah tabel hiperbolik-trigonometri: sinh, cosh, dan tanh

%untuk rentang -10<x<10 , dengan inkremen x sebesar 0,1.


%jawab:
% membuat vektor x
x=-10:0.1:10;
sinus=sin(x); cosinus=cos(x); tangent=tan(x);
%menampilkan tabel hiperbolik-trigonometri
disp('Tabel hiperbolik-trigonometri:'), ...
disp('x sin cos tan'), ...
disp('--------------------------------')
[x' sinus' cosinus' tangent']
Tabel hiperbolik-trigonometri:
x sin cos tan
--------------------------------

ans =
-10.0000
-9.9000
-9.8000
-9.7000
-9.6000
-9.5000
-9.4000
-9.3000
-9.2000
-9.1000
-9.0000
-8.9000
-8.8000
-8.7000
-8.6000
-8.5000
-8.4000
-8.3000
-8.2000
-8.1000
-8.0000
-7.9000
-7.8000
-7.7000
-7.6000
-7.5000
-7.4000
-7.3000

0.5440
0.4575
0.3665
0.2718
0.1743
0.0752
-0.0248
-0.1245
-0.2229
-0.3191
-0.4121
-0.5010
-0.5849
-0.6630
-0.7344
-0.7985
-0.8546
-0.9022
-0.9407
-0.9699
-0.9894
-0.9989
-0.9985
-0.9882
-0.9679
-0.9380
-0.8987
-0.8504

-0.8391
-0.8892
-0.9304
-0.9624
-0.9847
-0.9972
-0.9997
-0.9922
-0.9748
-0.9477
-0.9111
-0.8654
-0.8111
-0.7486
-0.6787
-0.6020
-0.5193
-0.4314
-0.3392
-0.2435
-0.1455
-0.0460
0.0540
0.1534
0.2513
0.3466
0.4385
0.5261

-0.6484
-0.5146
-0.3939
-0.2824
-0.1770
-0.0754
0.0248
0.1254
0.2286
0.3367
0.4523
0.5789
0.7211
0.8856
1.0820
1.3264
1.6457
2.0914
2.7737
3.9824
6.7997
21.7151
-18.5068
-6.4429
-3.8523
-2.7060
-2.0493
-1.6166

-7.2000
-7.1000
-7.0000
-6.9000
-6.8000
-6.7000
-6.6000
-6.5000
-6.4000
-6.3000
-6.2000
-6.1000
-6.0000
-5.9000
-5.8000
-5.7000
-5.6000
-5.5000
-5.4000
-5.3000
-5.2000
-5.1000
-5.0000
-4.9000
-4.8000
-4.7000
-4.6000
-4.5000
-4.4000
-4.3000

-0.7937
-0.7290
-0.6570
-0.5784
-0.4941
-0.4048
-0.3115
-0.2151
-0.1165
-0.0168
0.0831
0.1822
0.2794
0.3739
0.4646
0.5507
0.6313
0.7055
0.7728
0.8323
0.8835
0.9258
0.9589
0.9825
0.9962
0.9999
0.9937
0.9775
0.9516
0.9162

0.6084
0.6845
0.7539
0.8157
0.8694
0.9144
0.9502
0.9766
0.9932
0.9999
0.9965
0.9833
0.9602
0.9275
0.8855
0.8347
0.7756
0.7087
0.6347
0.5544
0.4685
0.3780
0.2837
0.1865
0.0875
-0.0124
-0.1122
-0.2108
-0.3073
-0.4008

-1.3046
-1.0649
-0.8714
-0.7091
-0.5683
-0.4428
-0.3279
-0.2203
-0.1173
-0.0168
0.0834
0.1853
0.2910
0.4031
0.5247
0.6597
0.8139
0.9956
1.2175
1.5013
1.8856
2.4494
3.3805
5.2675
11.3849
-80.7128
-8.8602
-4.6373
-3.0963
-2.2858

-4.2000
-4.1000
-4.0000
-3.9000
-3.8000
-3.7000
-3.6000
-3.5000
-3.4000
-3.3000
-3.2000
-3.1000
-3.0000
-2.9000
-2.8000
-2.7000
-2.6000
-2.5000
-2.4000
-2.3000
-2.2000
-2.1000
-2.0000
-1.9000
-1.8000
-1.7000
-1.6000
-1.5000
-1.4000
-1.3000
-1.2000
-1.1000
-1.0000
-0.9000
-0.8000
-0.7000
-0.6000
-0.5000
-0.4000
-0.3000
-0.2000
-0.1000
0
0.1000
0.2000
0.3000
0.4000
0.5000
0.6000
0.7000

0.8716 -0.4903 -1.7778


0.8183 -0.5748 -1.4235
0.7568 -0.6536 -1.1578
0.6878 -0.7259 -0.9474
0.6119 -0.7910 -0.7736
0.5298 -0.8481 -0.6247
0.4425 -0.8968 -0.4935
0.3508 -0.9365 -0.3746
0.2555 -0.9668 -0.2643
0.1577 -0.9875 -0.1597
0.0584 -0.9983 -0.0585
-0.0416 -0.9991 0.0416
-0.1411 -0.9900 0.1425
-0.2392 -0.9710 0.2464
-0.3350 -0.9422 0.3555
-0.4274 -0.9041 0.4727
-0.5155 -0.8569 0.6016
-0.5985 -0.8011 0.7470
-0.6755 -0.7374 0.9160
-0.7457 -0.6663 1.1192
-0.8085 -0.5885 1.3738
-0.8632 -0.5048 1.7098
-0.9093 -0.4161 2.1850
-0.9463 -0.3233 2.9271
-0.9738 -0.2272 4.2863
-0.9917 -0.1288 7.6966
-0.9996 -0.0292 34.2325
-0.9975 0.0707 -14.1014
-0.9854 0.1700 -5.7979
-0.9636 0.2675 -3.6021
-0.9320 0.3624 -2.5722
-0.8912 0.4536 -1.9648
-0.8415 0.5403 -1.5574
-0.7833 0.6216 -1.2602
-0.7174 0.6967 -1.0296
-0.6442 0.7648 -0.8423
-0.5646 0.8253 -0.6841
-0.4794 0.8776 -0.5463
-0.3894 0.9211 -0.4228
-0.2955 0.9553 -0.3093
-0.1987 0.9801 -0.2027
-0.0998 0.9950 -0.1003
0 1.0000
0
0.0998 0.9950 0.1003
0.1987 0.9801 0.2027
0.2955 0.9553 0.3093
0.3894 0.9211 0.4228
0.4794 0.8776 0.5463
0.5646 0.8253 0.6841
0.6442 0.7648 0.8423

0.8000
0.9000
1.0000
1.1000
1.2000
1.3000
1.4000
1.5000
1.6000
1.7000
1.8000
1.9000
2.0000
2.1000
2.2000
2.3000
2.4000
2.5000
2.6000
2.7000
2.8000
2.9000
3.0000
3.1000
3.2000
3.3000
3.4000
3.5000
3.6000
3.7000
3.8000
3.9000
4.0000
4.1000
4.2000
4.3000
4.4000
4.5000
4.6000
4.7000
4.8000
4.9000
5.0000
5.1000
5.2000
5.3000
5.4000
5.5000
5.6000
5.7000

0.7174
0.7833
0.8415
0.8912
0.9320
0.9636
0.9854
0.9975
0.9996
0.9917
0.9738
0.9463
0.9093
0.8632
0.8085
0.7457
0.6755
0.5985
0.5155
0.4274
0.3350
0.2392
0.1411
0.0416
-0.0584
-0.1577
-0.2555
-0.3508
-0.4425
-0.5298
-0.6119
-0.6878
-0.7568
-0.8183
-0.8716
-0.9162
-0.9516
-0.9775
-0.9937
-0.9999
-0.9962
-0.9825
-0.9589
-0.9258
-0.8835
-0.8323
-0.7728
-0.7055
-0.6313
-0.5507

0.6967
0.6216
0.5403
0.4536
0.3624
0.2675
0.1700
0.0707
-0.0292
-0.1288
-0.2272
-0.3233
-0.4161
-0.5048
-0.5885
-0.6663
-0.7374
-0.8011
-0.8569
-0.9041
-0.9422
-0.9710
-0.9900
-0.9991
-0.9983
-0.9875
-0.9668
-0.9365
-0.8968
-0.8481
-0.7910
-0.7259
-0.6536
-0.5748
-0.4903
-0.4008
-0.3073
-0.2108
-0.1122
-0.0124
0.0875
0.1865
0.2837
0.3780
0.4685
0.5544
0.6347
0.7087
0.7756
0.8347

1.0296
1.2602
1.5574
1.9648
2.5722
3.6021
5.7979
14.1014
-34.2325
-7.6966
-4.2863
-2.9271
-2.1850
-1.7098
-1.3738
-1.1192
-0.9160
-0.7470
-0.6016
-0.4727
-0.3555
-0.2464
-0.1425
-0.0416
0.0585
0.1597
0.2643
0.3746
0.4935
0.6247
0.7736
0.9474
1.1578
1.4235
1.7778
2.2858
3.0963
4.6373
8.8602
80.7128
-11.3849
-5.2675
-3.3805
-2.4494
-1.8856
-1.5013
-1.2175
-0.9956
-0.8139
-0.6597

5.8000
5.9000
6.0000
6.1000
6.2000
6.3000
6.4000
6.5000
6.6000
6.7000
6.8000
6.9000
7.0000
7.1000
7.2000
7.3000
7.4000
7.5000
7.6000
7.7000
7.8000
7.9000

-0.4646 0.8855
-0.3739 0.9275
-0.2794 0.9602
-0.1822 0.9833
-0.0831 0.9965
0.0168 0.9999
0.1165 0.9932
0.2151 0.9766
0.3115 0.9502
0.4048 0.9144
0.4941 0.8694
0.5784 0.8157
0.6570 0.7539
0.7290 0.6845
0.7937 0.6084
0.8504 0.5261
0.8987 0.4385
0.9380 0.3466
0.9679 0.2513
0.9882 0.1534
0.9985 0.0540
0.9989 -0.0460

-0.5247
-0.4031
-0.2910
-0.1853
-0.0834
0.0168
0.1173
0.2203
0.3279
0.4428
0.5683
0.7091
0.8714
1.0649
1.3046
1.6166
2.0493
2.7060
3.8523
6.4429
18.5068
-21.7151

8.0000
8.1000
8.2000
8.3000
8.4000
8.5000
8.6000
8.7000
8.8000
8.9000
9.0000
9.1000
9.2000
9.3000
9.4000
9.5000
9.6000
9.7000
9.8000
9.9000
10.0000

0.9894
0.9699
0.9407
0.9022
0.8546
0.7985
0.7344
0.6630
0.5849
0.5010
0.4121
0.3191
0.2229
0.1245
0.0248
-0.0752
-0.1743
-0.2718
-0.3665
-0.4575
-0.5440

-0.1455
-0.2435
-0.3392
-0.4314
-0.5193
-0.6020
-0.6787
-0.7486
-0.8111
-0.8654
-0.9111
-0.9477
-0.9748
-0.9922
-0.9997
-0.9972
-0.9847
-0.9624
-0.9304
-0.8892
-0.8391

-6.7997
-3.9824
-2.7737
-2.0914
-1.6457
-1.3264
-1.0820
-0.8856
-0.7211
-0.5789
-0.4523
-0.3367
-0.2286
-0.1254
-0.0248
0.0754
0.1770
0.2824
0.3939
0.5146
0.6484

Anda mungkin juga menyukai