필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

having troubling with push button

조회 수: 1 (최근 30일)
mira
mira 2015년 4월 20일
마감: MATLAB Answer Bot 2021년 8월 20일
I am having trouble in the pushbutton. I have 4 pushbutton and every push button has same calculation but different output. So, I want to display the result whenever either one pushbutton is pressed. I am trying to do with if else but it not work.
  댓글 수: 2
Geoff Hayes
Geoff Hayes 2015년 4월 23일
Mira - each push button should have its own callback to perform the calculation. How are you trying to use the if/else? Please post some of your code so that we can get an idea of what you are attempting to do.
mira
mira 2015년 4월 23일
Thank you to answer my question. But I got what I want. I use if/else but forgot to put the 'userdata' in the handles before.

답변 (1개)

Image Analyst
Image Analyst 2015년 4월 23일
What is "the result"? Is it some string (static text label) where you want to display some sentence with numbers in it? Is it a table/grid? Is it an image that you want to display? You can have the callback of each button call a function to display the result if you want:
DisplayResult(handles);
In DisplayResult() you can set the text label, display the image, plot the data, play the sound, or whatever it is you want to do. (It seems like you think we would somehow magically know what your result is, but we don't.)
  댓글 수: 1
mira
mira 2015년 4월 23일
sorry. forgot to state what the result is. The result is number. Thank you. I already get what I want.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by