Click here to load reader

10.GUI

  • View
    7

  • Download
    1

Embed Size (px)

Text of 10.GUI

  • Giao din ho ngi dng Matlab GUI Matlab GUI

    GUIDE

    Graphical User Interface Development Environment

    To chng trnh c giao din ho To chng trnh c giao din ho

    >> guide

    Ca s GUIDE Quick Start M v d ca Matlab GUI

  • V d v v th v biu

    RU

    Giao din GUI ca v d

    Menu

    Push Button

    Danh sch cc th Axes

    Chn th v v

    2. hn cp nht

    1. Chn

    3. th mi xut

    hin

    To mt chng trnh GUI n gingin

  • Bi tp

    To mt nt khi n vo th hin gi hin hnh.

    Bc 1: >> guide

    t tn file ca chng trnh

    GUIDE Layout editor

    Cc components

    Bc 2. Chn v t pushbutton

  • Bc 3. Chnh thuc tnh ca component Thay i gi tr thuc tnh

    Chui hin th trn buttontrn button

    Tn hm x l Callback

    Chy th ln 1 Nothing happen!

    Cha ci t x l cho button

  • Ci t Callback cho component Source code ca chng trnh

    Thm code x l t tn cho chng trnh

    Nhn phi chut vo khong trng.

    Chn Chn Property Inspector

    Chnh Name: Time

  • Chy li chng trnh

    Very good!Very good!

    Bi tp 2

    V th

    Yu cu HandleVisibility ca chng trnh callback

  • Chn v t Axes HandleVisibility ca Axes on

    Thm button Plot Ci t Callback cho button Plot

  • Chy th ln 1 Thm cc button grid on/off v clear

    Ci t callback cho Grid on/off Ci t callback cho Clear

  • Chy li chng trnh Bi tp thc hnh

    Nng cp bi v th thnh v nhiu th trn nhiu h trc to c cc nt iu khin ring.

    Hng dn:Hng dn:

    Hm axes(H)

    Bin handles.[tagname]

    Hm set(H,thuc tnh), get(H,thuc tnh)

    Xem V d ca Matlab Help.