Membuat GUI Matlab Sederhana Untuk Konversi Suhu Dengan Pop-Up Menu

GUI merupakan singkatan dari Grapichal User Interface. GUI merupakan salah satu fitur dalam matlab yang digunakan untuk menyajikan tampilan yang mudah untuk digunakan atau dibaca oleh pengguna (dalam istilahnya disebut juga aplikasi yang user friendly). Pada kesempatan kali ini, kami akan menampilkan contoh GUI sederhana untuk konversi suhu dengan menggunakan Pop-Up Menu. Pop-Up Menu adalah salah satu fitur dalam GUI yang digunakan untuk memilih plotting (ploting option) dalam bentuk daftar pilihan. Misalnya untuk konversi suhu yang kami buat, kita bisa memilih 3 konversi suhu yang kita inginkan yaitu Celcius (C) ke Reamur (R), Celcius (C) ke Fahrenheit (F), dan Celcius (C) ke Kelvin (K). Sebagaimana yang kita ketahui dalam fisika dasar kita mengenal rumus konversi suhu sebagai berikut.

1. Celcius (C) ke Reamur (R)

R = (4/5) C

R = suhu dalam skala Reamur
C = suhu dalam skala Celcius

2. Celcius ke Fahrenheit (F)

F = (9/5) C + 32

F = suhu dalam skala Fahrenheit
C = suhu dalam skala Celcius

3. Celcius (C) ke Kelvin (K)

K = C + 273

K = suhu dalam Kelvin
C = suhu dalam Celcius

Rumus-rumus tersebut akan kita gunakan pada Matlab untuk konversi suhu. Jika kita ingin meggunakan rumus tersebut pada Matlab maka kita harus menuliskannya dengan syntax yang benar (sesuai penulisan bahasa pemrograman matlab yang benar). Berikut tampilan aplikasi konversi suhu :

part1

Pada Pop-Up Menu “Pilih Konversi”, kita bisa memilih 3 macam konversi seperti tampilan berikut :

 

part2

 

Algoritma fungsi callback untuk Pop-Up Menu di atas sebagai berikut :

alg1

 

Kita simpan pilihan konversi dalam variabel mode ( mode 1, mode 2, mode 3) untuk nanti dipanggil pada fungsi callback start.

Kemudian masukkan suhu celcius seperti tampilan berikut ini :

part3

Algoritma fungsi callback untuk input text di atas sebagai berikut :

alg2

mode = 1 hanya digunakan untuk inisial konversi saja (artinya tanpa memilih pilihan konversi maka otomatis suhu akan dikonversi dari Celcius ke Reamur). “Celcius” pada algoritma di atas adalah variable untuk menyimpan input text yang kita masukkan dalam bentuk string (kumpulan karakter).

Kemudian klik start untuk kalkulasi sekaligus instruksi untuk menampilkan hasil konversi seperti tampilan berikut :

part5 Algoritma fungsi callback untuk push buttom Start di atas sebagai berikut :

alg4

 

Dari program di atas kita, pertama program memanggil mode konversi ( mode =handles.mode) dan membaca input text yang kita tuliskan (Celcius = eval(get(handles.Celcius, ‘String’));). Setelah itu program akan mengkalkulasi data sesuai pilihan mode ( mode 1, mode 2, mode 3) dan menampilkannya pada hasil konversi (set(handles.hasil,’string’,hasil_konversi);). Kita bisa lihat tampilan hasil konversi 25 Derajat Celcius menjadi 20 Derajat Reamur sebagai berikut :

part4

Algoritma fungsi callback untuk output text di atas sebagai berikut :

alg3

Yang kita butuhkan hanya nama variablenya saja yaitu “hasil” sebagai alamat tujuan untuk menampilkan data.

Setelah selesai mengkonversi suhu sesuai yang diinginkan, maka kita bisa meutup aplikasi ( close) dengan instruksi close seperti yang ada pada fungsi callback berikut :

alg5

Demikian tutorial GUI Matlab Sederhana untuk konversi suhu dengan menggunakan Pop-Up Menu. Apabila ada pertanyaan atau kurang paham, anda bisa menghubungi langsung ke contact person HWsmartsolution di nomor 081210889296 atau email hwsmartsolution@gmail.com, ataupun comment di bawah.

Terimakasih.

Artikel-artikel terkait :

  1. Tutorial Membuat Lembar Kerja GUI (Grapichal User Interface) Matlab.
  2. Cara Membuka dan Menampilkan Image dengan menggunakan GUI Matlab.
  3. Membuat Program GUI Matlab untuk Menampilkan Data Tabel Excell.
  4. Menambahkan Noise pada Citra/Image & Menampilkannya dengan Menggunakan Matlab.

Be Sociable, Share!

You may also like...

34 Responses

  1. RockyAnsell says:

    Do you need unique articles for your page ? Remember, content is
    king nowadays. Unique content every day = rank increase.
    Simply search in gogle for: Elmit’s essential tool

  2. try this out says:

    I just want to say I’m all new to blogging and site-building and absolutely liked this web-site. Very likely I’m want to bookmark your site . You actually have impressive stories. Regards for revealing your webpage.

  3. great post says:

    I simply want to tell you that I’m very new to blogs and certainly loved you’re web-site. Almost certainly I’m going to bookmark your website . You surely come with wonderful posts. Regards for sharing with us your web-site.

  4. great page says:

    I simply want to say I am just newbie to blogs and absolutely savored your web blog. Probably I’m planning to bookmark your blog post . You absolutely have fantastic articles. Thanks for sharing your web-site.

  5. read page says:

    I simply want to tell you that I am just all new to blogging and honestly enjoyed this blog site. Almost certainly I’m planning to bookmark your blog . You really come with perfect articles and reviews. Thanks a bunch for sharing your webpage.

  6. full content says:

    I simply want to mention I’m newbie to blogging and site-building and definitely liked your blog site. Almost certainly I’m going to bookmark your blog . You actually have excellent article content. Thank you for sharing with us your website.

  7. browse page says:

    I simply want to mention I am just new to blogs and honestly enjoyed your blog site. Very likely I’m going to bookmark your blog . You actually have awesome stories. Appreciate it for sharing your website page.

  8. I have been reading out some of your articles and i can claim pretty good stuff. I will definitely bookmark your site.

  9. I have been examinating out some of your articles and i can state pretty clever stuff. I will surely bookmark your site.

  10. Medicaid says:

    It¡¦s really a nice and useful piece of information. I am satisfied that you just shared this useful info with us. Please keep us up to date like this. Thanks for sharing.

  11. Hello.This post was extremely fascinating, particularly because I was looking for thoughts on this subject last week.

  12. Keep working ,impressive job!

  13. Lovely website! I am loving it!! Will come back again. I am bookmarking your feeds also

  14. ppob tektaya says:

    I have learn several excellent stuff here. Definitely worth bookmarking for revisiting. I surprise how a lot attempt you set to make such a wonderful informative website.

  15. Auto Repair says:

    My brother suggested I might like this website. He was totally right. This post actually made my day. You can not imagine simply how much time I had spent for this information! Thanks!

  16. I am continuously searching online for ideas that can help me. Thx!

  17. I want to get across my gratitude for your kindness for people who really need help with this important idea. Your personal dedication to passing the solution along had become pretty valuable and have usually helped workers much like me to achieve their aims. Your own informative advice denotes much a person like me and still more to my mates. Thank you; from everyone of us.

  18. I actually wanted to send a small note to be able to say thanks to you for all of the great instructions you are placing here. My incredibly long internet research has finally been recognized with excellent ideas to write about with my family members. I would tell you that many of us visitors actually are rather fortunate to be in a really good site with very many perfect individuals with very beneficial solutions. I feel really privileged to have discovered your entire webpages and look forward to many more enjoyable minutes reading here. Thanks a lot once again for everything.

  19. Corrupcion says:

    It’s hard to come by experienced people about this subject, but you sound like you know what you’re talking about! Thanks

  20. I definitely wanted to write a small remark to be able to say thanks to you for all of the unique ideas you are giving at this site. My considerable internet look up has finally been rewarded with really good content to exchange with my family members. I ‘d express that we site visitors actually are undoubtedly blessed to dwell in a wonderful network with many lovely people with valuable tricks. I feel very privileged to have come across the site and look forward to many more brilliant times reading here. Thanks again for all the details.

  21. Remodeling says:

    I¡¦ll right away snatch your rss as I can’t find your email subscription hyperlink or newsletter service. Do you have any? Please permit me realize in order that I could subscribe. Thanks.

  22. Very efficiently written information. It will be valuable to everyone who employess it, including me. Keep up the good work – looking forward to more posts.

  23. Good – I should definitely pronounce, impressed with your web site. I had no trouble navigating through all the tabs and related info ended up being truly easy to do to access. I recently found what I hoped for before you know it in the least. Reasonably unusual. Is likely to appreciate it for those who add forums or something, site theme . a tones way for your customer to communicate. Excellent task.

  24. This website was… how do I say it? Relevant!! Finally I have found something that helped me. Many thanks!|

  25. Remodeling says:

    Great blog! I am loving it!! Will come back again. I am bookmarking your feeds also

  26. Earl Hindman says:

    I truly appreciate this post. I have been looking everywhere for this! Thank goodness I found it on Bing. You have made my day! Thank you again

  27. Very soon this web page will be famous among all blog viewers, due to it’s good posts|

  28. I wanted to write you one bit of remark to be able to give many thanks over again regarding the incredible things you’ve discussed on this page. This is really incredibly generous with you to allow unhampered what most of us might have offered for sale for an electronic book to make some dough on their own, particularly considering the fact that you could have tried it if you decided. The solutions as well acted to provide a easy way to recognize that most people have a similar dreams much like my own to find out a lot more pertaining to this problem. I’m sure there are thousands of more enjoyable opportunities in the future for those who start reading your blog.

  29. Donn Siemek says:

    website|your web site} for more soon.

  30. Latest Tech says:

    Lovely blog! I am loving it!! Will come back again. I am bookmarking your feeds also

  31. Mathematic says:

    I do consider all of the ideas you have offered on your post. They are really convincing and will definitely work. Nonetheless, the posts are very quick for newbies. Could you please extend them a bit from next time? Thank you for the post.

  32. Polo says:

    Magnificent beat ! I would like to apprentice while you amend your site, how could i subscribe for a blog web site? The account aided me a acceptable deal. I had been tiny bit acquainted of this your broadcast provided bright clear idea

  33. I am not sure where you’re getting your info, but great topic. I needs to spend some time learning much more or understanding more. Thanks for fantastic information I was looking for this information for my mission.

Leave a Reply

Your email address will not be published. Required fields are marked *