フィルターのクリア

Simple question for GUI

2 ビュー (過去 30 日間)
Dan
Dan 2012 年 7 月 4 日
Hi, I'm new to programming and Matlab, so just a simple question:
If I make a pushbutton and an edit text, what is the code so that when I push the pushbutton a text appears in the edit text area?
For example if the edit text is set to "hello" I want it to change to "how are you?" when you press the button.
Thank you very much! Daniel

採用された回答

Dr. Seis
Dr. Seis 2012 年 7 月 4 日
Also wanted to add a good resource for those who want to learn how to program a variety of things in Matlab GUIs:
  1 件のコメント
Kevin Claytor
Kevin Claytor 2012 年 7 月 4 日
Nice!

サインインしてコメントする。

その他の回答 (2 件)

Kevin Claytor
Kevin Claytor 2012 年 7 月 4 日
編集済み: Kevin Claytor 2012 年 7 月 4 日
You'll need to know the tag of the pushbutton if you're using GUIDE, you can double click to open the properties and find it there. This is how your reference that object. Then use get and set to set the values;
set(button_tag,'String','New String For Button');
You'll find get(handle) and set(handle) are extremely useful for finding properties you can set and then setting them.

Dan
Dan 2012 年 7 月 4 日
Niceee!! Many thanks!! Never expected such quick replies!

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by