change GUI result automatically
조회 수: 1 (최근 30일)
이전 댓글 표시
Hii... I need help about GUI, because I am just a beginner in MATLAB. I have a simple calculation, say a+b=c. I use slider to change the value of "a" and "b". Here I want the value of "c" changes automatically when I press left arrow or right one of the slider ( either "a" or "b"), without clicking a button.
Thank you very much Muammar
댓글 수: 2
답변 (3개)
jeff wu
2012년 5월 3일
did u make it with guide or did you write the gui? you have do give the element that shall change something a callback function like
uicontrol('style','pushbutton',... %some other options,...
jeff wu
2012년 5월 3일
i wast finischt there actually,
..., 'Callback',@myfunction);
then you write somewhere else the function:
function myfunction(~,~) here you write the code for the sum c = a+b; and then with the set method you change the valu in the uicontrol where c is written in end
i hope this was understandable,
i would need your code to be more explicit
best regards, jeff
댓글 수: 0
Jan
2012년 5월 3일
You can insert the callback of the pushbutton as callback of the sliders also. The slider callbacks are called, when the slider position changes. Then you can update the value of "a" or "b" at first and afterwards call the function, which triggers the calculation.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!