ENGR 132 - QUIZ16

ENGR 132 - QUIZ16 - 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 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.
Background image of page 2
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
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 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

Page1 / 6

ENGR 132 - QUIZ16 - 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