How to link gui push button with the matlab code m files.

回答 (1 件)

Adam
Adam 2014 年 11 月 12 日

0 投票

Just call your m-file in the push button callback.
If that isn't enough information try giving more information in your question!

2 件のコメント

zionna
zionna 2014 年 11 月 12 日
Thanks for your answer. First I would browse an image using browser button and that image obtained should be further segmented using the pushbutton(segment) where its coding is written in m file. So how to link it. It would be helpful if the corresponding coding is provided for it. Thank you.
Adam
Adam 2014 年 11 月 12 日
In a callback you can store data on the handles structure so, for example your filename coming back from a browse instruction (e.g. a uigetfile) in your browse button callback:
handles.filename = uigetfile;
guidata( hObject, handes );
Then in your other callback you can access that file by simply
handles.filename
e.g.
fread( handles.filename,... )
or whatever instruction you want. Then call your m-file to do whatever you want. If you want to store anything else in your GUI use handles as in the example above.

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

カテゴリ

ヘルプ センター および File ExchangeInteractive Control and Callbacks についてさらに検索

質問済み:

2014 年 11 月 12 日

コメント済み:

2014 年 11 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by