Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.

Slides:



Advertisements
Similar presentations
MATLAB and Scilab Comparison
Advertisements

MEG 361 CAD Chapter 3 Basic Concepts of Graphics Programming.
Lab # 03- SS Basic Graphic Commands. Lab Objectives: To understand M-files principle. To plot multiple plots on a single graph. To use different parameters.
Lecture 14 User-defined functions Function: concept, syntax, and examples © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
Introduction to MATLAB for Biomedical Engineering BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Lesson 2: Element-wise vs. matrix operations.
CITS2401 Computer Analysis & Visualisation
Graphics in MATLAB Week 15 – 5/5/09 Kate Musgrave
Chapter 7 Introduction to High-Level Language Programming.
Get number The ginput command creates crosshairs. When the user clicks the x,y values of the crosshairs are returned.
Graphics Output Primitives Pixel Addressing and Fill Area Dr. M. Al-Mulhem Feb. 1, 2008.
Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab 9: 3D & Projections Basics.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
MATLAB and Simulinklecture 31 To days Outline  Functions  Strings  Sparse Arrays  Cell Arrays  Structures  Exercises on this days topics.
Geometry Equations of a Circle.
An introduction to Plotting in MATLAB Rikard Johansson Department of Biomedical Engineering (IMT) Linköping University
MATLAB and SimulinkLecture 11 To days Outline  Introduction  MATLAB Desktop  Basic Features  Branching Statements  Loops  Script file / Commando.
Georgia Institute of Technology Speed part 3 Barb Ericson Georgia Institute of Technology May 2006.
Matlab tutorial course Exercises 2:. Exercises Copy the script ‘face_points.m’ from my webpage into your ‘scripts’ folder Create a new folder in your.
ENG College of Engineering Engineering Education Innovation Center 1 2D Plots 1 in MATLAB Topics Covered: 1.Plotting basic 2-D plots The plot()
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
ELG 3120 Signal and System Analysis 1 Introduction to MATLAB TAs Wei Zhang Ozgur Ekici (Section A)(Section B) ELG 3120 Lab Tutorial 1.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Introduction to Matlab & Data Analysis
Lecture 5: Interaction 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 711,  ex 2271 
Matlab Programming for Engineers Dr. Nidal Farhat Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
MATLAB Tutorial EE 327 Signals and Systems 1. What is MATLAB? MATLAB – Matrix Laboratory The premier number-crunching software Extremely useful for signal.
The set of files includes : Tcl source of the POLYGON program The database (file obtained initially by P.Afonine from using phenix.model_vs_data.
COMP 116: Introduction to Scientific Programming Lecture 5: Plotting, Scripts and publishing.
Introduction to Matlab’s Graphical User Interface (GUI) Type “guide” “Guide” creates interface on a Figure window and code in an M-file. Some hidden code.
MAE 1202: AEROSPACE PRACTICUM An Introduction to MATLAB: Part 2 Mechanical and Aerospace Engineering Department Florida Institute of Technology Developed.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Post-Processing Output with MATLAB Claudia Fricke Institute of Petroleum Engineering, Heriot Watt University.
CS112 Scientific Computation Department of Computer Science Wellesley College Building your own Functions.
1 EMT 101 – Engineering Programming Dr. Farzad Ismail School of Aerospace Engineering Universiti Sains Malaysia Nibong Tebal Pulau Pinang Week 11.
ENG 1181 College of Engineering Engineering Education Innovation Center MATLAB – 2D Plots 1 Go to the class drive: ---> MatLab - Graphing ---> Seed Files.
1 DKT 211 Basic Communication Engineering LAB # 1A : (Lecture 1) Introduction to Matlab  Basic Features  Scientific features  Array Operations  Script.
Chapter 6 Review: User Defined Functions Introduction to MATLAB 7 Engineering 161.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 6B Methods (Tutorial)
MATLAB for Engineers 4E, by Holly Moore. © 2014 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected by Copyright.
Lec 16 Chapter 10 Nov 2, 11 Chapter 10, user interface design examples.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
5.7 Use Figures in Three – Dimensional Space Pg.205.
Matlab tutorial course Exercises 5: Loading and writing images
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Getting started with the turtle Find the latest version of this document at
Documenting a function. Documenting a function definition We have a template for information that we need you to put at the top of each function - if.
Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab 10: 3D & Projections Advanced.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab.
Week 10 - Friday.  What did we talk about last time?  References and primitive types  Started review.
GeometryGeometry Equations of Circles. GeometryGeometry Finding Equations of Circles You can write an equation of a circle in a coordinate plane if you.
MATLAB and SimulinkLecture 61 To days Outline Graphical User Interface (GUI) Exercise on this days topics.
Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab 9: 3D & Projections Basics.
Do Now Write the equation for the locus of points 5 units from the point (-5,6)
Structured Computer Programming EE 201 Introduction to MATLAB 7 for Engineers بسم الله الرحمن الرحيم King Abdulaziz University College of Engineering Dept.
Beginning Programming for Engineers Animation. Special matrix functions >> clear >> ones(2,3) >> zeros(3,5) >> ones(2) >> zeros(3) >> eye(4) >> magic(4)
EEE 242 Computer Tools for Electrical Engineering
How to use MATLAB (using M-files) Double click this icon To start Matlab 6.5.
Session III Plotting in MATLAB Rajeev Madazhy Dept of Mechanical Engineering LSU MATLAB Tutorials.
ENGINEERING 1D04 Tutorial 4. What are we doing today? Focus Functions Scope of Variables Returning Values Objects Graphics library Aliasing Events Mouse.
Computer Application in Engineering Design
Two-Dimensional Plots
User Defined Functions
MATLAB How to use (using M-files) Double click this icon
MATLAB – What Is It ? Name is from matrix laboratory Powerful tool for
MATLAB Tutorial Dr. David W. Graham.
MATLAB How to use (using M-files) Double click this icon
MATLAB How to use (using M-files)
Introduction to Matlab LAB 4
Presentation transcript:

Written by: Itzik Ben Shabat Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering Lab 3 : Clock Self Exercise

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

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

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

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

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

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

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

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

Written by: Itzik Ben Shabat Matlab Graphics basics Mathworks Documentation Center Technion - Israel Institute of Technology Faculty of Mechanical Engineering Laboratory for CAD & Lifecycle Engineering