ENGR 132 - QUIZ16

# ENGR 132 - QUIZ16 - ENGR 132 Tues/Thurs 9:30-11:30 Quiz 16...

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

Click to edit Master subtitle style 4/24/11 ENGR 132 Wed/Fri 3:30-5:30

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

View Full Document
4/24/11 Quiz 16 – Team Quiz A GUI has been created with the following components 1 push button (tag: pushbutton1) 1 axes (tag: axes1) Write the code required in the callback for pushbutton1 to plot the function sin(x) in the axes over the x interval -5 to 5 when the push button is pressed. Ensure the plot is smooth. You DO NOT need to include the function definition line for the callback or any of the comments that are automatically created by GUIDE. Make the plot appropriate for technical presentation.
4/24/11 Solution - Quiz 16 x=-5:0.1:5 y=sin(x) axes(handles.ax es1) plot(x,y) title(‘Sine Wave’) xlabel(‘x’) ylabel(‘sin(x)’) +1 (reasonable increment) +1 +3 (give partial credit) +2 +1 +1 +1

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

View Full Document
Click to edit Master subtitle style

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

View Full Document
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 Quiz 16 A GUI has been created with the following components 1 toggle button(tag: togglebutton1) 1 pushbutton (tag: pushbutton1) Write the code required in the callback for pushbutton1 to store the property ‘Value’ of the toggle button in variable a. If the value of a is 1, fprintf the statement “Button On”, and if the value of a is 0, fprintf the statement “Button Off”. You DO NOT need to include the function definition line for the callback or any of the comments that are automatically created by GUIDE. 4/24/11 Solution - Quiz 16 a=get(handles.togglebutton1, ‘Value’) if a ==1 fprintf(‘Button On’) else fprintf(‘Button Off’) end +5 (give partial credit) +1 +1 +1 (could use elseif) +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.

### Page1 / 6

ENGR 132 - QUIZ16 - ENGR 132 Tues/Thurs 9:30-11:30 Quiz 16...

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

View Full Document
Ask a homework question - tutors are online