ENGR 132 - QUIZ17 - 4/24/11 ENGR 132 Tues/Thurs 9:30-11:30...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Click to edit Master subtitle style 4/24/11 ENGR 132 Wed/Fri 3:30-5:30
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4/24/11 Quiz 17 A GUI has been created with the following components radiobutton (tag: radiobutton1) radiobutton (tag: radiobutton2) 1 axes (tag: axes1) Write the code required to plot the experimental data stored in handles.x, handles.y (already defined in the GUI file) on a linear scale if radiobutton1 is selected and on a loglog scale if radiobutton2 is selected. Ensure if one radiobutton is selected that the other radiobutton is turned off. Clearly indicate on your paper which callback you are in (no need to include function definition line or comments).
Background image of page 2
4/24/11 Solution - Quiz 17 In Callback for radiobutton1 set(handles.radiobutton2, ‘Value’, 0) axes(handles.axes1) plot(handles.x, handles.y, ‘ko’) % xlabel, ylabel, title, etc In Callback for radiobutton2 set(handles.radiobutton1, ‘Value’, 0) axes(handles.axes1) loglog(handles.x,handles.y, ‘ko’) % xlabel, ylabel, title, etc +2 +1 +2 – must have markers +2 +1 +2 – must have markers
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Click to edit Master subtitle style
Background image of page 4
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 4/24/11 ENGR 132 Tues/Thurs 9:30-11:30 4/24/11 TEAM Quiz 17 A GUI has been created with the following components 1 edit text (tag: edit1) 1 pushbutton (tag: pushbutton1) 1 static text (tag: text1) The user is supposed to enter a number in the edit text box. Write the code required in the callback for pushbutton 1 to determine if the user entered a number. If a number was entered the Property String of the static text box should be set to Valid Input when the pushbutton is pressed; otherwise, Invalid Input should appear. You DO NOT need to include the function definition line for the callback or any of the comments created by GUIDE. Helpful functions from 12A: whos, class, isnumeric, 4/24/11 Solution - Quiz 17 a=get(handles.edit1, String) b=str2num(a) c=isempty(b) if c ==0 set(handles.text1, String, Valid Input) else set(handles.text1, String, Invalid Input) end + 6 (for a,b,c may be done in 1 step may be combined with if) +2 for if/else +1 +1...
View Full Document

This note was uploaded on 04/23/2011 for the course ENGR 132 taught by Professor Kutson during the Spring '11 term at Purdue University-West Lafayette.

Page1 / 6

ENGR 132 - QUIZ17 - 4/24/11 ENGR 132 Tues/Thurs 9:30-11:30...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online