Develop a GUI-based adder program, in MATLAB, using the programmatic approach. Y
ID: 3829222 • Letter: D
Question
Develop a GUI-based adder program, in MATLAB, using the programmatic approach. Your GUI should consist of 5 control objects: 2 editable text-boxes for operands, a pushbutton (located between the text-boxes if your GUI is organized horizontally. Generally, it should be to the left of the second operand text-box) with a plus sign on it, a non-editable text-box with an equal sign, and to the right of that, a non-editable text-box where the result of the addition of the items found in the 2 operand text-boxes is to be displayed. Your program should use the boilerplate for a single callback (shown in examples found in the class notes) that makes tagged objects available via the handles structure. The contents of all text-boxes should be initialized to 0.0 when the program starts.
Make sure that your adder works. It should allow its user to enter 2 operands (numbers) and then add them when the plus button is pressed, placing the sum in the result text-box. Put your name in the title-bar of the main window of your GUI, use a color scheme that you like for backgrounds and foregrounds, make sure the fonts are large enough to be readable, but not so large as to make users dizzy. Paste the code of your adder in the space below, and take a screen snapshot of your running program, save it as jpeg or png and paste-insert it in your homework document, above the code (it helps to place the figure inside the top row of a table with 2 rows x 1 column, and no borders, and place an explanatory caption in the 2nd row).
Explanation / Answer
function input1_editText_Callback(hObject, eventdata, handles)
a = get(handles.input1_editText,'String');
c = num2str(total);
set(handles.answer_staticText,'String',c);
guidata(hObject, handles);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.