Page 27 - Modul Kalfis Matlab Gerak Vertikal_Neat
P. 27

5.  Memprogram Komponen GUI


                  m-file yang telah dibuat sebelumnya akan otomatis

                  terbuka  dan  kita  harus  menuliskan  programnya
                  agar  komponen  kontrol  dapat  bekerja.  Untuk

                  membuat  program  dalam  m-file  kita  cukup
                  memperhatikan  fungsi-fungsi  MATLAB  bertanda

                  callback dimana perintah disisipkan.


                   1)  Codingan Push button satu/ GVB


                      % --- Executes on button press in Jawab.
                      function  Jawab_Callback(hObject,  eventdata,

                      handles)

                      % hObject    handle to Jawab (see GCBO)
                      %  eventdata    reserved  -  to  be  defined  in  a

                      future version of MATLAB
                      %  handles        structure  with  handles  and  user

                      data (see GUIDATA)


                      Vo = str2double(get(handles.Vo,'string'));

                      t = str2double(get(handles.t,'string'));
                      g = str2double(get(handles.g,'string'));



                                          24
   22   23   24   25   26   27   28   29   30   31   32