Download presentation
Presentation is loading. Please wait.
Published byJustin Stephens Modified over 8 years ago
1
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab 3 : Clock Self Exercise
2
Written by: Itzik Ben Shabat Tutorial Goals Implementation of previously learned subjects and topics Experience building a personal code Experience working with functions Experience working with graphic handles Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering
3
Written by: Itzik Ben Shabat Exercise Write a code that will generate the following graphic window output Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering
4
Written by: Itzik Ben Shabat Property definition Code using at least 3 functions – Main3() – no input and no output – main running function DrawingCB() – no input and no output – called from main and contains all drawing elements Drawclock – gets an axis handle, radius and circle center coordinates (x0,y0) and returns the Clock graphic object handle Figure title ‘your name clock’ Hide axes ticks Use line or plot to draw the circle Use markers to plot the yellow circles around the clock Window size and location– square (nXn) as you wish Colors – as you wish Make sure to comment properly Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering
5
Written by: Itzik Ben Shabat Grouping Objects In the future we would like to perform operations on a few graphic objects at once To simplify that we can group graphic handles to a group handle by using the following syntax GroupHandle = hggroup; Set(objects_handles,'Parent',GroupHandle); Group all the handles you created and see what this line does set(GroupHandle,'Visible','off') Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering
6
Written by: Itzik Ben Shabat Desired Output Your result should look like this Try to change the clock variables (Radius, center) and see how it effects (or doesn’t effect) the output. Display the ticks to see the change Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering
7
Written by: Itzik Ben Shabat Minimal submission The minimal demands for this lab submissions are up to this point. Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering
8
Written by: Itzik Ben Shabat Property definition Copy your code to a new file (save the previous version) Create a new function that draws only a circle (no markers) at a given point and with a given radius DrawCirc – gets radius and circle center coordinates (x0,y0) and returns the circle graphic object handle This function creates what we call a geometric primitive Use it to draw the large circle and all the small circles (instead of using the markers) Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering
9
Written by: Itzik Ben Shabat Desired Output Your result should look like this Try to change the clock variables (Radius, center) and see how it effects (or doesn’t effect) the output. Display the ticks to see the change Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering
10
Written by: Itzik Ben Shabat Matlab Graphics basics Mathworks Documentation Center - http://www.mathworks.com/help/documentation-center.html http://www.mathworks.com/help/documentation-center.html Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.