Selasa, 24 Maret 2020

GRAFIK 3 DIMENSI PADA MATLAB

Menggunakan fungsi-fungsi built-in pada MATLAB. Ada 3 macam fungsi MATLAB yang sering digunakan untuk menggabar grafik tiga dimensi ini, yaitu :  
1.   Mesh
digunakan memvisualisasikan data dalam bentuk tiga dimensi. mesh sering disebut sebagai grafik jala yang memiliki empat titik data terdekat dalam ruang 3D.
2.  Surf
Atau grafik permukaan, untuk memvalidasikan data dalam bentuk permukaan 3D dengan pewarnaan berdasarkan bobot nilai gridnya.
3.  Contour
digunakan untuk membuat gariskontur dibuat dengan teknik inperpolasi titik-titik terdekat.

Untuk menjelaskan fungsi-fungsi tersebut, diperhatikan beberapa contoh berikut.

Contoh, misalkan akan dibuat kurva seperti dibawah ini       


Tulis scrib file berikut :

function eka5_OpeningFcn(hObject, eventdata, handles, varargin)

handles.peaks = peaks(35);
handles.membrane = membrane;
[x, y] = meshgrid(-8:0.5:8);
r = sqrt (x.^2+ y.^2)+ eps;
sinc = sin (r)./r;
handles.current_data = handles.peaks;
surf(handles.current_data);
handles.peaks = peaks(35);
handles.membrane = membrane;
[x, y] = meshgrid(-8:0.5:8);
r = sqrt(x.^2 + y.^2) +eps;
sinc = sin (r)./r;
handles.sinc = sinc;
handles.current_data = handles.peaks;
surf (handles.current_data);


Hasilnya seperti ini :

Selanjutnya dengan memasukan fungsi file scrib pada setiap popup menu dan pushbotton :

a.   Pop up menu

function popupmenu2_Callback(hObject, eventdata, handles)
val = get (hObject, 'value');
str = get (hObject, 'string');
switch str{val}
    case 'peaks' 
        handles.current_data = handles.peaks;
    case 'membrane' 
        handles.current_data = handles.membrane;
    case 'sinc' 
        handles.current_data = handles.sinc;
end
guidata(hObject, handles);

b.   Pushbotton 1

function pushbutton1_Callback(hObject, eventdata, handles)
surf (handles.current_data);

c.  Pushbotton 2
function pushbutton2_Callback(hObject, eventdata, handles)
mesh (handles.current_data);

d.   Pushbotton 3
function pushbutton3_Callback(hObject, eventdata, handles)
contour (handles.current_data);

Setelah semua file scrib ditulis klik run untuk melihat hasilnya.

1.   Pilih Surf, klik pop up menu dibawah ini maka akan muncul gambar-gambar seperti dibawah ini sesuai pop up menu yang dipilih ;
a.      Peak


b.     Membrane


c.      Sinc



2.  Pilih Mesh, klik pop up menunya maka akan muncul gambar-gambar seperti dibawah ini sesuai pop up menu yang dipilih ;
a.      Peak


b.     Membrane


c.      Sinc



3.  Pilih Contour, klik pop up menunya maka akan muncul gambar-gambar seperti dibawah ini sesuai pop up menu yang dipilih ;
a.      Peak


b.     Membrane


c.      Sinc


Itulah tutorial sedikit dari saya mengenai pembuatan Grafik 3D pada aplikasi Matlab, jika ada Kritik dan saran silahkan ketik di kolom komentar J, Terimkasih J  



Senin, 09 Maret 2020

PROGRAM GRAYSCALE MENGGUNAKAN MATLAB









MATLAB adalah kependekan dari MATrix LABoratory dikarenakan setiap data pada MATLAB menggunakan dasar matriks. MATLAB adalah bahasa pemrograman tinggi, tertutup, dan case sensitive dalam lingkungan komputasi numerik yang dikembangkan oleh MathWorks. Salah satu kelebihannya yang paling populer adalah kemampuan membuat grafik dengan visualisasi terbaik. MATLAB mempunyai banyak tools yang dapat membantu berbagai disiplin ilmu. Ini merupakan salah satu penyebab industri menggunakan MATLAB. Selain itu MATLAB mempunyai banyak library yang sangat membantu untuk menyelesaikan permasalahan matematika seperti membuat simulasi fungsi, pemodelan matematika dan perancangan GUI.
GRAYSCALE adalah berbagai nuansa warna monokromatik dari hitam menjadi putih. Oleh karena itu, gambar grayscale hanya memiliki warna abu-abu dan tidak berwarna.

Langkah langkah dalam pembuatan program matlab grayscale :
1. Buka aplikasi MATLAB, Klik menu HOME, lalu klik NEW.
2. Klik GUIDE Quick Start, lalu pilih Blank GUI lalu pilih Browser sebagai tempat simpan program. Klik OK.
3. Selanjutnya akan muncul gambar dseperti dibawah ini :

4. setelah itu buatlah seperti gambar dibawah ini :


   dimana terdapat fitur Axes1, Axes2, pushbutton1 dengan nama "Open Image", pushbutton2 dengan nama     "Greyscale", pushbutton3 dengan nama "Save Image", tambahkan textbox pada fitur Edit Text dan Slider.

5. Untuk memasukkan coding padang pushbutton1 (Open Image)  dan yang lain, klik pushbutton>klik kanan>pilih view lalu callbacks.

6. coding pushbutton1 (Open image)
     
    function pushbutton1_Callback(hObject, eventdata, handles)
[name_file1,name_path1] = uigetfile (.....
    {'*.bmp;*.jpg;*.tif','files of type (*.bmp,*.jpg,*.tif)';
    '*.bmp','file Bitmap (,.bmp)';..........
    '*.jpg','file jpeg (*.jpg)';
    '*.tif','file Tif (*.tif)';
    '*.*','All files (*.*)'},.....
    'Open Image');

if ~isequal (name_file1,0)
    handles.data1 = imread (fullfile(name_path1,name_file1));
    guidata(hObject,handles);
    axes(handles.axes1);
    imshow(handles.data1);
else
    return;
end

7.  Coding Pushbutton2 (Grayscale)

     function pushbutton2_Callback(hObject, eventdata, handles)
image1 = handles.data1;
gray = rgb2gray(image1);
axes(handles.axes2);
imshow(gray);
handles.data2=gray;
guidata(hObject,handles);

8. coding pusbutton3 (save image)

    function pushbutton3_Callback(hObject, eventdata, handles)
thresh=handles.data3;
[name_file_save,path_save] = uiputfile (...
    {'*.bmp','file bitmap (*.bmp)';...
    '*.jpg','file jpeg (*.jpg)';
    '*.tif','file Tif (*.tif)';
    '*.*','All Files (*.*)'},...
    'SAVE IMAGE');

if ~isequal (name_file_save,0)
   imwrite(thresh,fullfile(path_save,name_file_save));
else
    return;
end

9. coding Slider1 

    function slider1_Callback(hObject, eventdata, handles)
gray=handles.data2;
value=get(handles.slider1,'value');
thresh=imcomplement(im2bw(gray,value/255));
axes(handles.axes2);
imshow(thresh);
handles.data3=thresh;
guidata(hObject,handles);
set(handles.edit1,'string',value)

10. selanjutnya klik run, dan akan tampil gambar dibawah ini :

11.  Untuk Menjalankan Program, klik Open Image dan akan muncul gambar seperti dibawah ini :

12. klik Grayscale akan tampil seperti ini :
       

13. untuk mengubah warna RGB, kalian bisa klik slider
       

14. setelah itu klik Save Image
       


     cek juga save as type, disini saya menggunakan Bitmab Image atau .bmp

15. haasil akhir
       







----SELESAI----

Selasa, 12 Desember 2017

Tugas 3.7 PT. PULANG PETANG SETIAP HARI


Private Sub cmdbatal_Click()
txtnama.Text = ""
txtnik.Text = ""
Txtgol.Text = ""
txtkode.Text = ""
txtstatus.Text = ""
txttahun.Text = ""
txtjabatan.Text = ""
txtbagian.Text = ""
txtgaji.Text = ""
txttj.Text = ""
txttotal.Text = ""
txtnama.SetFocus
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
txtnama.Text = ""
txtnik.Text = ""
Txtgol.Text = ""
txtkode.Text = ""
txtstatus.Text = ""
txttahun.Text = ""
txtjabatan.Text = ""
txtbagian.Text = ""
txtgaji.Text = ""
txttj.Text = ""
txttotal.Text = ""
txtnama.SetFocus
End Sub

Private Sub cmdproses_Click()
Dim S As String
txttahun.Text = Left(txtnik.Text, 4)
S = Mid(txtnik.Text, 5, 1)
If S = "A" Then
Txtgol.Text = "A"
txtjabatan.Text = "Manajemen"
txtgaji.Text = "4000000"
txttj.Text = "1025000"
ElseIf S = "B" Then
Txtgol.Text = "B"
txtjabatan.Text = "Ka. Seksi"
txtgaji.Text = "3500000"
txttj.Text = "975000"
ElseIf S = "C" Then
Txtgol.Text = "C"
txtjabatan.Text = "Staff"
txtgaji.Text = "3000000"
txttj.Text = "925000"
End If
S = Mid(txtnik.Text, 7, 1)
If S = "S" Then
txtkode.Text = "S"
txtstatus.Text = "Single"
ElseIf S = "M" Then
txtkode.Text = "M"
txtstatus.Text = "Menikah"
ElseIf S = "J" Then
txtkode.Text = "J"
txtstatus.Text = "Janda"
ElseIf S = "D" Then
txtkode.Text = "D"
txtstatus.Text = "Duda"
End If
S = Right(txtnik.Text, 3)
If S = "KEU" Then
txtbagian.Text = "Accounting"
ElseIf S = "ADM" Then
txtbagian.Text = "Administrasi"
ElseIf S = "SDM" Then
txtbagian.Text = "General Affair"
ElseIf S = "EDP" Then
txtbagian.Text = "IT Unit"
ElseIf S = "SPM" Then
txtbagian.Text = "Security"
End If
txttotal.Text = Val(txtgaji.Text) + Val(txttj.Text)
End Sub

Tugas 3.6 DATA BUKU STMIK PRINGSEWU


Private Sub cmdbatal_Click()
Txtkode.Text = ""
txtjudul.Text = ""
txtpengarang.Text = ""
txttahun.Text = ""
txtpenerbit.Text = ""
txtharga.Text = ""
Txtkode.SetFocus
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
Txtkode.Text = ""
txtjudul.Text = ""
txtpengarang.Text = ""
txttahun.Text = ""
txtpenerbit.Text = ""
txtharga.Text = ""
Txtkode.SetFocus
End Sub

Private Sub cmdproses_Click()
Dim A As String
A = Left(Txtkode.Text, 3)
If A = "SIM" Then
txtjudul.Text = "Sistem Informasi"
txtpengarang.Text = "Fadiya Ulfa"
txtharga.Text = "75900"
ElseIf A = "EDP" Then
txtjudul.Text = "Elektronik Data Processing"
txtpengarang.Text = "Nurul Agustina"
txtharga.Text = "62000"
ElseIf A = "MNJ" Then
txtjudul.Text = "Manajemen"
txtpengarang.Text = "Riyan Hidayat"
txtharga.Text = "42000"
ElseIf A = "CDR" Then
txtjudul.Text = "Corel draw"
txtpengarang.Text = "Siti Nur Khotimah"
txtharga.Text = "53000"
ElseIf A = "RPL" Then
txtjudul.Text = "Rekayasa Perangkat Lunak"
txtpengarang.Text = "Winda Erlianti"
txtharga.Text = "83000"
End If
txttahun.Text = "20" & Mid(Txtkode.Text, 5, 2)
A = Right(Txtkode.Text, 1)
If A = "A" Then
txtpenerbit.Text = "Andi Offset Yogyakarta"
ElseIf A = "I" Then
txtpenerbit.Text = "Indah Surabaya"
ElseIf A = "S" Then
txtpenerbit.Text = "Salemba Empat"
ElseIf A = "E" Then
txtpenerbit.Text = "Elek Media Komputindo"
ElseIf A = "M" Then
txtpenerbit.Text = "Maxicom"
End If
End Sub

Tugas 3.5 Penjualan Tiket Kereta Api


Private Sub cmdlagi_Click()
Txtkode.Text = ""
txtharga.Text = ""
txtjenis.Text = ""
txtjam.Text = ""
txtjumlah.Text = ""
txttotal.Text = ""
Txtkode.SetFocus
End Sub

Private Sub cmdout_Click()
End
End Sub

Private Sub cmdproses_Click()
Dim B As String

B = Left(Txtkode.Text, 3)
If B = "BIM" Then
txtharga.Text = "50000"
txtjenis.Text = "BIMA"
txtjam.Text = "16.00"
ElseIf B = "EKO" Then
txtharga.Text = "35000"
txtjenis.Text = "EKONOMI"
txtjam.Text = "19.00"
ElseIf B = "MUT" Then
txtharga.Text = "23000"
txtjenis.Text = "MUTIARA"
txtjam.Text = "17.00"
ElseIf B = "SEN" Then
txtharga.Text = "15000"
txtjenis.Text = "SENJA"
txtjam.Text = "20.00"
End If
txtjumlah.SetFocus
End Sub

Private Sub txtjumlah_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txttotal.Text = Val(txtharga.Text) * Val(txtjumlah.Text)
End If
End Sub

Tugas 3.4 Data Buku STMIK PRINGSEWU


Private Sub cbokodebuku_Click()
Select Case cbokodebuku.Text
Case "A-SIM-01"
Case "I-EDP-02"
Case "S-MNJ-03"
Case "E-CDR-04"
Case "M-RPL-05"
End Select
End Sub

Private Sub cmdbatal_Click()
cbokodebuku.SetFocus
cbokodebuku.Text = ""
Txtjb.Text = ""
txtpeng.Text = ""
txttater.Text = ""
txtpen.Text = ""
txtharga.Text = ""
End Sub

Private Sub cmdkeluar_Click()
End
End Sub

Private Sub cmdlagi_Click()
cbokodebuku.SetFocus
cbokodebuku.Text = ""
Txtjb.Text = ""
txtpeng.Text = ""
txttater.Text = ""
txtpen.Text = ""
txtharga.Text = ""
End Sub

Private Sub cmdproses_Click()
Dim A As String
A = Left(cbokodebuku, 1)
If A = "A" Then
txtpen.Text = "ANDI OFFSET YOGYAKARTA"
ElseIf A = "I" Then
txtpen.Text = "INDAH SURABAYA"
ElseIf A = "S" Then
txtpen.Text = "SALEMBA EMPAT"
ElseIf A = "E" Then
txtpen.Text = "ELEK MEDIA KOMPUTINDO"
ElseIf A = "M" Then
txtpen.Text = "MAXICOM"
End If
A = Mid(cbokodebuku, 3, 3)
If A = "SIM" Then
Txtjb.Text = "Sistem Informasi Menejemen"
txtpeng.Text = "YATI NUR OKTAVIA"
txtharga.Text = "75900"
ElseIf A = "EDP" Then
Txtjb.Text = "Elektronik Data Prosesing"
txtpeng.Text = "IMAM TARMIZI"
txtharga.Text = "62000"
ElseIf A = "MNJ" Then
Txtjb = "Menejemen"
txtpeng.Text = "VALENTINA MARIANA ADIWIANTI"
txtharga.Text = "42000"
ElseIf A = "CDR" Then
Txtjb.Text = "corel draw"
txtpeng.Text = "RIYAN SUHANDI"
txtharga.Text = "53000"
ElseIf A = "RPL" Then
Txtjb.Text = "Rekayasa Perangkat Lunak"
txtpeng.Text = "SINTA UMPU SINGA"
txtharga.Text = "83000"
End If
txttater.Text = "20" & Right(cbokodebuku, 2)
End Sub

Private Sub Form_Load()
cbokodebuku.AddItem "A-SIM-01"
cbokodebuku.AddItem "I-EDP-02"
cbokodebuku.AddItem "S-MNJ-03"
cbokodebuku.AddItem "E-CDR-04"
cbokodebuku.AddItem "M-RPL-05"
End Sub


TUGAS 3.3 Entri Penjualan Laptop Apple



Private Sub cbokode_Click()
Dim Penjualan, discount, kode, merk, bayar As String
Dim Harga As Variant

merk = Mid(cbokode.Text, 7, 5)
If merk = "MC965" Then
txtmerk.Text = "Apple MacBook Air MC965"
Harga = "12800000"
ElseIf kode = "MC966" Then
txtmerk.Text = "Apple MacBook Air MC966"
Harga = "15800000"
ElseIf merk = "MC968" Then
txtmerk.Text = "Apple MacBook Air MC968"
Harga = "9900000"
ElseIf merk = "MC969" Then
txtmerk.Text = "Apple MacBook Air MC969"
Harga = "11900000"
ElseIf merk = "MC700" Then
txtmerk.Text = "Apple MacBook Air MC700"
Harga = "10800000"
ElseIf merk = "MC721" Then
txtmerk.Text = "Apple MacBook Air MC721"
Harga = "15900000"
ElseIf merk = "MC723" Then
txtmerk.Text = "Apple MacBook Air MC723"
Harga = "19300000"
ElseIf merk = "MC724" Then
txtmerk.Text = "Apple MacBook Air MC724"
Harga = "13700000"
ElseIf merk = "MC311" Then
txtmerk.Text = "Apple MacBook Air MC311"
Harga = "24200000"
ElseIf merk = "MC313" Then
txtmerk.Text = "Apple MacBook Air MC313"
Harga = "11900000"
ElseIf merk = "MC314" Then
txtmerk.Text = "Apple MacBook Air MC314"
Harga = "14700000"
ElseIf merk = "MC318" Then
txtmerk.Text = "Apple MacBook Air MC318"
Harga = "17600000"
ElseIf merk = "MC322" Then
txtmerk.Text = "Apple MacBook Air MC322"
Harga = "21300000"
ElseIf merk = "MC965" Then
txtmerk.Text = "Apple MacBook Air MC965"
Harga = "12800000"
ElseIf merk = "MC966" Then
txtmerk.Text = "Apple MacBook Air MC966"
Harga = "15800000"
End If
txtmerk.Text = merk
txths.Text = Harga
Txtjuju.SetFocus
End Sub

Private Sub cmdhitung_Click()
cbokode.SetFocus
cbokode.Text = ""
txtmerk.Text = ""
txths.Text = ""
Txtjuju.Text = ""
txthp.Text = ""
txtdis.Text = ""
txttoba.Text = ""
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdproses_Click()
txthp.Text = Val(Txtjuju.Text) * Val(txths.Text)
If txthp.Text > 140000000 Then
txtdis.Text = 0.15 * txthp.Text
ElseIf txthp.Text > 135000000 Then
txtdis.Text = 0.1 * txthp.Text
ElseIf txthp.Text > 130000000 Then
txtdis.Text = 0.05 * txthp.Text
ElseIf txthp.Text > 125000000 Then
txtdis.Text = 0.02 * txthp.Text
Else
txtdis.Text = 0
End If
txttoba.Text = Val(txthp.Text) - Val(txtdis.Text)
End Sub

Private Sub Form_Load()
cbokode.AddItem "Apple MC965 MasBook Air"
cbokode.AddItem "Apple MC966 MasBook Air"
cbokode.AddItem "Apple MC968 MasBook Air"
cbokode.AddItem "Apple MC969 MasBook Air"
cbokode.AddItem "Apple MC700 MasBook Pro"
cbokode.AddItem "Apple MC721 MasBook Pro"
cbokode.AddItem "Apple MC723 MasBook Pro"
cbokode.AddItem "Apple MC724 MasBook Pro"
cbokode.AddItem "Apple MC311 MasBook Pro"
cbokode.AddItem "Apple MC313 MasBook Pro"
cbokode.AddItem "Apple MC314 MasBook Pro"
cbokode.AddItem "Apple MC318 MasBook Pro"
cbokode.AddItem "Apple MC322 MasBook Pro"
cbokode.AddItem "Apple MC965 MasBook Air"
cbokode.AddItem "Apple MC966 MasBook Air"
End Sub

Tugas 3.1


Private Sub cbogol_Click()
Dim gapok, pajak, tunjangan, total As Variant
Select Case cbogol.Text
Case "I"
gapok = 1500000
tunjangan = 150000
Case "II"
gapok = 2000000
tunjangan = 200000
Case "III"
gapok = 2500000
tunjangan = 250000
Case "IV"
gapok = 3000000
tunjangan = 300000
Case Else
gapok = 0
tunjangan = 0
End Select
total = gapok + tunjangan
pajak = total * 0.1
txtgp.Text = gapok
txttj.Text = tunjangan
txtpj = pajak
txttt.Text = total - pajak
End Sub

Private Sub cmdbatal_Click()
kosong
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
kosong
End Sub

Private Sub Form_Load()
cbogol.AddItem "I"
cbogol.AddItem "II"
cbogol.AddItem "III"
cbogol.AddItem "IV"
End Sub
Public Sub kosong()
Txtnidn.SetFocus
Txtnidn = ""
txtnp = ""
cbogol = ""
txtgp = ""
txttj = ""
txtpj = ""
txttt = ""
End Sub

Private Sub Txtnidn_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnp.SetFocus
End If
End Sub

Senin, 11 Desember 2017

TUGAS 3.2



Private Sub cmdbatal_Click()
Txtnama.SetFocus
Txtnama = ""
txtnpm = ""
txtjurusan = ""
txtprodi = ""
txttm = ""
txtnorut = ""
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub cmdlagi_Click()
Txtnama.SetFocus
Txtnama = ""
txtnpm = ""
txtjurusan = ""
txtprodi = ""
txttm = ""
txtnorut = ""
End Sub

Private Sub cmdproses_Click()
Dim s As String
txttm.Text = "20" & Left(txtnpm.Text, 2)
s = Mid(txtnpm.Text, 3, 1)
If s = "1" Then
txtjurusan.Text = "Sistem Informasi"
ElseIf s = "2" Then
txtjurusan.Text = "Menejemen Informasi "
ElseIf s = "3" Then
txtjurusan.Text = "Tehnik Komputer"
ElseIf s = "4" Then
txtjurusan.Text = "Menejemen & Komp. Akuntansi"
End If
s = Mid(txtnpm.Text, 4, 2)
If s = "01" Then
txtprodi.Text = "strata satu"
ElseIf s = "02" Then
txtprodi.Text = "Diploma Tiga"
ElseIf s = "03" Then
txtprodi.Text = "Diploma Empat"
ElseIf s = "04" Then
txtprodi.Text = "Diploma Dua"
End If
txtnorut.Text = Right(txtnpm.Text, 3)
End Sub

Private Sub form_activate()
Txtnama.SetFocus
Txtnama = ""
txtnpm = ""
txtjurusan = ""
txtprodi = ""
txttm = ""
txtnorut = ""
End Sub

Private Sub Txtnama_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtnpm.SetFocus
End If

End Sub

Selasa, 21 November 2017

tugas 2.8 huruf mutu mahasiswa stmik pringsewu menggunakan keypress


Private Sub Cbonpm_Click()
Dim nama, jurusan, HM As String

Select Case Cbonpm.Text
Case "17100016"
nama = "Yanna Chairunisa Alwahida"
jurusan = " Sistem Informasi"
Case "17100004"
nama = "Eka Kartika Pertiwi"
jurusan = "Sistem Informasi"
Case "17100028"
nama = "Ida Ayu Wulandari"
jurusan = "Sistem Informasi"
Case "17100001"
nama = "Mardalenna"
jurusan = "Sistem Informasi"
Case "17100021"
nama = "Ahmad Hilal Yusuf"
jurusan = "Manajemen Informatika"
Case "17100006"
nama = "Rosi Elvia"
jurusan = "Sistem Informasi"
End Select
Txtnama.Text = nama
Txtjurusan.Text = jurusan
Txtquis.SetFocus
End Sub

Private Sub cmdbatal_Click()
Cbonpm.SetFocus
Cbonpm.Text = ""
Txtnama.Text = ""
Txtjurusan.Text = ""
Txtquis.Text = ""
Txttugas.Text = ""
Txtuts.Text = ""
Txtuas.Text = ""
Txtna.Text = ""
Txthm.Text = ""
End Sub

Private Sub cmdbproses_Click()
Dim NA As Integer
Dim HM As String
quis = Val(Txtquis.Text)
tugas = Val(Txttugas.Text)
uts = Val(Txtuts.Text)
uas = Val(Txtuas.Text)
NA = (quis + tugas + uts + uas) / 4
Txtna.Text = NA

Select Case Txtna.Text
Case Is > 80
HM = "A"
Case Is > 70
HM = "B"
Case Is > 60
HM = "C"
Case Is > 50
HM = "D"
Case Is < 50
HM = "E"
End Select
Txthm.Text = HM
End Sub

Private Sub cmdkeluar_Click()
Unload Me
End Sub

Private Sub Form_Load()
Cbonpm.AddItem "17100016"
Cbonpm.AddItem "17100004"
Cbonpm.AddItem "17100028"
Cbonpm.AddItem "17100001"
Cbonpm.AddItem "17100021"
Cbonpm.AddItem "17100006"

End Sub

Private Sub Txtquis_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txttugas.SetFocus
End If
End Sub

Private Sub Txttugas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtuts.SetFocus
End If
End Sub

Private Sub Txtuas_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Dim NA As Integer
Dim HM As String
quis = Val(Txtquis.Text)
tugas = Val(Txttugas.Text)
uts = Val(Txtuts.Text)
uas = Val(Txtuas.Text)
NA = (quis + tugas + uts + uas) / 4
Txtna.Text = NA

Select Case Txtna.Text
Case Is > 80
HM = "A"
Case Is > 70
HM = "B"
Case Is > 60
HM = "C"
Case Is > 50
HM = "D"
Case Is < 50
HM = "E"
End Select
Txthm.Text = HM
End If
End Sub

Private Sub Txtuts_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Txtuas.SetFocus
End If
End Sub

GRAFIK 3 DIMENSI PADA MATLAB

M enggunakan fungsi-fungsi built-in pada MATLAB. Ada 3 macam fungsi MATLAB yang sering digunakan untuk menggabar grafik tiga dimensi in...