Semester Project Introduction Computer control of a cutting machine 1. Given a data file description of desired 2-D parts 2. Create software tools to:

Slides:



Advertisements
Similar presentations
What is a Database By: Cristian Dubon.
Advertisements

Introduction to Matlab
Structured Design. 2 Design Quality – Simplicity “There are two ways of constructing a software design: One is to make it so simple that there are obviously.
Chapter 2: Modularization
Prentice Hall, Database Systems Week 1 Introduction By Zekrullah Popal.
Chapter 7 – Serial-Parallel Circuits Introductory Circuit Analysis Robert L. Boylestad.
ITEC113 Algorithms and Programming Techniques
Introduction to Computers and Programming Lecture 11: Introduction to Methods Professor: Evan Korth New York University.
Introduction to Computers and Programming Introduction to Methods in Java.
C Lecture Notes 1 Program Control (Cont...). C Lecture Notes 2 4.8The do / while Repetition Structure The do / while repetition structure –Similar to.
Software Architecture Design Instructor: Dr. Jerry Gao.
Get number The ginput command creates crosshairs. When the user clicks the x,y values of the crosshairs are returned.
Functions MATLAB’s power comes from functions Functions allow projects to be partitioned into manageable, testable, reusable modules.
 Monday, 9/30/02, Slide #1 CS106 Introduction to CS1 Monday, 9/30/02  QUESTIONS (on HW02, etc.)??  Today: Libraries, program design  More on Functions!
Computers: Tools for an Information Age
Week 11 - Programming IV Today 1. Vectorization to simplify programs 2. Structured software Definition: array operations versus loops 1.masks (indicator.
Semester Project Introduction Computer control of a cutting machine 1. Given a data file description of desired 2-D parts 2. Create software tools to:
Project reports are due at the final Monday May 8 11:30 am Reports should contain a paragraph describing the contribution of each team member. Who did.
Chapter 2: Developing a Program Extended and Concise Prelude to Programming Concepts and Design Copyright © 2003 Scott/Jones, Inc.. All rights reserved.
Chapter 2: Developing a Program Prelude to Programming Concepts and Design Copyright © 2001 Scott/Jones, Inc.. All rights reserved. 1 Chapter 2 Developing.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
Chapter 9: Coupling & Cohesion Omar Meqdadi SE 273 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Attribute Data in GIS Data in GIS are stored as features AND tabular info Tabular information can be associated with features OR Tabular data may NOT be.
1 CMPT 275 High Level Design Phase Architecture. Janice Regan, Objectives of Design  The design phase takes the results of the requirements analysis.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 6 Value- Returning Functions and Modules.
Introduction to Computational Linguistics Programming I.
A First Book of ANSI C Fourth Edition
Modular Programming. Modular Programming (1/6) Modular programming  Goes hand-in-hand with stepwise refinement and incremental development  Makes the.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. C How To Program - 4th edition Deitels Class 05 University.
Course Web Page Most information about the course (including the syllabus) will be posted on the course wiki:
Chapter 06 (Part I) Functions and an Introduction to Recursion.
Memory Layout and SLC500™ System Addresses. Processor Memory Division An SLC 500 processor's memory is divided into two storage areas. Like two drawers.
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Chapter 2.
Introduction to MATLAB Session 3 Simopekka Vänskä, THL Department of Mathematics and Statistics University of Helsinki 2011.
Subprograms CE 311 K - Introduction to Computer Methods Daene C. McKinney.
Cohesion and Coupling CS 4311
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Chapter 10 Software Engineering. Understand the software life cycle. Describe the development process models. Understand the concept of modularity in.
Data Structure Introduction.
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
Chapter 1 – Matlab Overview EGR1302. Desktop Command window Current Directory window Command History window Tabs to toggle between Current Directory &
The basics of the programming process The development of programming languages to improve software development Programming languages that the average user.
Working with Arrays in MATLAB
Nested References. Simple Reference A simple reference is a file attached to the active, or master file in a read-only manner for viewing and plotting.
First Steps in Modularization. Simple Program Design, Fourth Edition Chapter 8 2 Objectives In this chapter you will be able to: Introduce modularization.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Functions Outline 5.1Introduction 5.2Program Modules.
1 Lab 1. C Introduction  C: –Developed by Bell lab. in –a procedure-oriented programming language.  Developing environments: –Editing –Preprocessing.
KIC/Computer Programming & Problem Solving 1.  Introduction  Program Modules in C  Math Library Functions  Functions  Function Definitions  Function.
Programming at a high level. Developing a Computer Program Programmer  Writes program in source code (VB or other language) Compiler  Converts source.
OCR GCSE Computing © Hodder Education 2013 Slide 1 OCR GCSE Computing Python programming 1: Introduction.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming Introduction to simple functions.
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Chapter 8 Arrays. A First Book of ANSI C, Fourth Edition2 Introduction Atomic variable: variable whose value cannot be further subdivided into a built-in.
Systems Design.  Application Design  User Interface Design  Database Design.
Introduction to Functions CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Modern Systems Analysis and Design Third Edition Chapter 2 Succeeding as a Systems Analyst 2.1.
Flowcharts C++ Lab. Algorithm An informal definition of an algorithm is: a step-by-step method for solving a problem or doing a task. Input data A step-by-step.
Chapter 9: Coupling & Cohesion Omar Meqdadi SE 273 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Designing Functions CSIS 1595: Fundamentals of Programming and Problem Solving 1.
Introduction GIS often represent spatial information with a two-dimensional x,y coordinate system. Some data linearly measured. In order to use the information.
Structured Programming The Basics
CSCI-235 Micro-Computer Applications
11/10/2018.
Unit# 8: Introduction to Computer Programming
Problem Solving Techniques
Chapter 1 Introduction(1.1)
Topics Introduction to Value-returning Functions: Generating Random Numbers Writing Your Own Value-Returning Functions The math Module Storing Functions.
Basic Concepts of Algorithm
Presentation transcript:

Semester Project Introduction Computer control of a cutting machine 1. Given a data file description of desired 2-D parts 2. Create software tools to: a. Compute the characteristics of the parts (area, perimeter, centroid locations) b. Solve for the cutter route (simplest to most efficient) c. Graphically display results

fscanf Create a link to a file fid = fopen(‘filename’) Read a line of data x = fscanf(fid, %f, 2) Close the link close(fid) Number of values read

Example Data format: –Polygonal parts –List of vertices –(0,0) as the separator Data file: x Desired cut pattern y

Structured Programming Divide and subdivide the project. Write functions for the parts. Manage complexity Debugable Readable Testable Reusable functions Maintainable

Structured Programming Hierarchical Modules are divided into smaller and smaller submodules (functions work well as modules) functions contain functions Modular Simple independent modules with well defined inputs and outputs Locality Minimize inputs and outputs Generate values inside the module where possible

Example 1 – clipping a time plot to [-1,1]: Time (sec.)

Method 1 – using a loop and branch: for k = 1:length(y) if y(k) > 1 y(k) = 1; elseif y(k) < -1 y(k) = -1; end

Method 2 – using mask math: p = y>1; n = y<-1; y = (1-p).*(1-n).*y + p - n; or p = y>1; n = y<-1; y = ~p.*~n.*y + p - n; “mask” arrays to indicate locations with relevant characteristics use masks either mathematically or logically

Method 3 – using mask addressing: p = y>1; or n = y<-1; y(p) = 1;y(y>1) = 1; y(n) = -1;y(y<-1) = -1; mask determines which elements to change

Method 1 – loop and branch: for k = 1:size(score,1) if score(k,1) < score(k,2) score(k,:) = score(k,[2 1]); end size with second argument 1 returns the number of rows

Method 2 – using mask addressing: flip = score(:,1)<score(:,2); score(flip,[1 2]) = score(flip,[2 1]) identify which rows to swap and reverse them