MATLAB Basics 9 loops

Size: px
Start display at page:

Download "MATLAB Basics 9 loops"

Transcription

1 1 MATLAB Basics 9 loops Anthony Rossiter University of Sheffield For a neat organisation of all videos and resources

2 Introduction 1. We have established that using script files for sequences of operations is useful. 2. Sometimes, it is useful to repeat the same operation over and over again, but with slightly different numbers each time. 3. MATLAB provides a convenient mechanism for this by way of loop structures. 4. These resources cover an introduction to basic loop structures (for loops and while loops). The coding is largely intuitive and follows reasoning common to humans and thus is easy and transparent to code. 2

3 Loops are essential Code allows repeated numerical computations. We do not want to write a line of code multiple times to do the same thing with different numbers. We want to tell the computer to use the same line, but with different numbers.

4 Common loop structures 4 For loops Specify exactly which values change during the repeated operations and how many times the operation is repeated. While loops. Use a conditional to decide whether the loop action should be repeated or not. This was covered in the previous videos with conditionals.

5 matlab_basics9e.m Open the file. 1. Two ways to compute 6 values 2. First look at lines Or try lines Now imagine you needed to do this for 100 different values, or a Using a loop is simple to code and efficient.

6 How does a for loop work? equivalently k=[1,2,3,4,5,6] Back to start of loop for k=1:6; end y2(k)=sin(xvalues(k)); more code First k=1 hence do y2(1)=sin(xvalues(1)); Now k=2 hence do y2(2)=sin(xvalues(2)); Now k=3 k=4 hence do do Y2(3)=sin(xvalues(3)); y2(4)=sin(xvalues(4)); Now k=5 hence do Now y2(5)=sin(xvalues(5)); k=6 hence do y2(6)=sin(xvalues(6)); Now k=6 is equal to max of allowed k, continue to next line of code

7 How to write the statement for k=3:8 code end for k=4:3:13 code end k takes the values 3,4,5,6,7,8 k takes the values 8,6,4,2 k takes the values 4,7,10,13 for k=8:-2:2 end code

8 Generalisation 8 One can write a statement like: for k=[a,b,c,d,e,,f]; CODE that depends on k end Equivalently for k=vec; vec a vector Where it is noted the values k takes in the loop do not need to be equi-spaced.

9 General examples of for loops Open the file matlab_basics9a.m Note the for loop statement has 3 variables. Run in the command window Note values of k are: start, start+step, start+2*step,,start+ 6*step

10 Nested loops Open matlab_basics9b.m Note that one loop is inside another loop. First k=1 and then l goes from 1 to 5. Next k=2 and then l goes from 1 to 5.. Finally k=10 and then l goes from 1 to 5. Inner loop Outer loop Run the file and experiment with changing the loop for statements

11 Loop counters can be variables 11 It may be that the number of times a loop is needed, or indeed the variables to be used in the loop are unknown during coding and supplied as a user input, or as a consequence of earlier code. This is illustrated with a simple example in matlab_basics9f.m In general, for the statement for counter=a:b:c; CODE; end All of a,b,c can be determined as a consequence of earlier code and/or USER Input.

12 12 LIVE DEMONSTRATIONS WITH MATLAB

13 Files to look at 13 matlab_basics9a.m matlab_basics9b.m matlab_basics9c.m matlab_basics9d.m matlab_basics9e.m matlab_basics9f.m

14 Conclusions 14 Demonstrated the usefulness of for loops for executing the same command multiple times, with slightly different numerical values. Allows complex computations to be tested and saved for easy use later. In general terms, for loops are one of the most common structures used in coding and thus it is essential students become skilled in these.

15 For a neat organisation of all videos and resources Anthony Rossiter Department of Automatic Control and Systems Engineering University of Sheffield University of Sheffield This work is licensed under the Creative Commons Attribution 2.0 UK: England & Wales Licence. To view a copy of this licence, visit or send a letter to: Creative Commons, 171 Second Street, Suite 300, San Francisco, California 94105, USA. It should be noted that some of the materials contained within this resource are subject to third party rights and any copyright notices must remain with these materials in the event of reuse or repurposing. If there are third party images within the resource please do not remove or alter any of the copyright notices or website details shown below the image. (Please list details of the third party rights contained within this work. If you include your institutions logo on the cover please include reference to the fact that it is a trade mark and all copyright in that image is reserved.)

MATLAB Basics 2 simple calculations and use

MATLAB Basics 2 simple calculations and use 1 MATLAB Basics 2 simple calculations and use Anthony Rossiter University of Sheffield For a neat organisation of all videos and resources http://controleducation.group.shef.ac.uk/indexwebbook.html Introduction

More information

Simultaneous equations 11 Row echelon form

Simultaneous equations 11 Row echelon form 1 Simultaneous equations 11 Row echelon form J A Rossiter For a neat organisation of all videos and resources http://controleducation.group.shef.ac.uk/indexwebbook.html Introduction 2 The previous videos

More information

MATLAB Basics 8 conditionals if statements

MATLAB Basics 8 conditionals if statements 1 MATLAB Basics 8 conditionals if statements Anthony Rossiter University of Sheffield For a neat organisation of all videos and resources http://controleducation.group.shef.ac.uk/indexwebbook.html Introduction

More information

State-space feedback 6 challenges of pole placement

State-space feedback 6 challenges of pole placement State-space feedbac 6 challeges of pole placemet J Rossiter Itroductio The earlier videos itroduced the cocept of state feedbac ad demostrated that it moves the poles. x u x Kx Bu It was show that whe

More information

Parallelizing Loops. Moreno Marzolla Dip. di Informatica Scienza e Ingegneria (DISI) Università di Bologna.

Parallelizing Loops. Moreno Marzolla Dip. di Informatica Scienza e Ingegneria (DISI) Università di Bologna. Moreno Marzolla Dip. di Informatica Scienza e Ingegneria (DISI) Università di Bologna http://www.moreno.marzolla.name/ Copyright 2017, 2018 Moreno Marzolla, Università di Bologna, Italy (http://www.moreno.marzolla.name/teaching/hpc/)

More information

Repetition Through Recursion

Repetition Through Recursion Fundamentals of Computer Science I (CS151.02 2007S) Repetition Through Recursion Summary: In many algorithms, you want to do things again and again and again. For example, you might want to do something

More information

This is the basis for the programming concept called a loop statement

This is the basis for the programming concept called a loop statement Chapter 4 Think back to any very difficult quantitative problem that you had to solve in some science class How long did it take? How many times did you solve it? What if you had millions of data points

More information

EGR 102 Introduction to Engineering Modeling. Lab 10A Nested Programming II Iterative Nesting

EGR 102 Introduction to Engineering Modeling. Lab 10A Nested Programming II Iterative Nesting EGR 102 Introduction to Engineering Modeling Lab 10A Nested Programming II Iterative Nesting 1 Overview 1. Nested loops 2. Nested loop: Creating Arrays 3. Nested Loops: 2 Variable functions 4. Nested Loops

More information

How to create an order in Online Business Account (OBA)

How to create an order in Online Business Account (OBA) How to create an order in Online Business Account (OBA) How to create an order With Online Business Account, creating an order is easy to do: 1. Select the correct mailing option to reflect whether you

More information

Iterative Languages. Scoping

Iterative Languages. Scoping Iterative Languages Scoping Sample Languages C: static-scoping Perl: static and dynamic-scoping (use to be only dynamic scoping) Both gcc (to run C programs), and perl (to run Perl programs) are installed

More information

Topics. Introduction to Repetition Structures Often have to write code that performs the same task multiple times. Controlled Loop

Topics. Introduction to Repetition Structures Often have to write code that performs the same task multiple times. Controlled Loop Topics C H A P T E R 4 Repetition Structures Introduction to Repetition Structures The for Loop: a Count- Sentinels Nested Loops Introduction to Repetition Structures Often have to write code that performs

More information

e-portfolios: Adding Images

e-portfolios: Adding Images Why should I use images in my e-portfolio? Using images can help you establish a distinct personality in your e-portfolio. Images enhance the design of your portfolio and provide evidence of your professional

More information

EGR 111 Loops. This lab is an introduction to loops, which allow MATLAB to repeat commands a certain number of times.

EGR 111 Loops. This lab is an introduction to loops, which allow MATLAB to repeat commands a certain number of times. EGR 111 Loops This lab is an introduction to loops, which allow MATLAB to repeat commands a certain number of times. New MATLAB commands: for, while,, length 1. The For Loop Suppose we want print a statement

More information

In this simple example, it is quite clear that there are exactly two strings that match the above grammar, namely: abc and abcc

In this simple example, it is quite clear that there are exactly two strings that match the above grammar, namely: abc and abcc JavaCC: LOOKAHEAD MiniTutorial 1. WHAT IS LOOKAHEAD The job of a parser is to read an input stream and determine whether or not the input stream conforms to the grammar. This determination in its most

More information

Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.

Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License. Open Curaçao? 2010 10 07 Presentation during BPM Seminar Small Scale Renewable Energy: solutions on the horizon Curaçao, 2005-2010 Suares & Co NV This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike

More information

SlideBoom Frequently Asked Questions

SlideBoom Frequently Asked Questions SlideBoom Frequently Asked Questions SlideBoom is a presentation-sharing website that allows users to share PowerPoint presentations with a general audience or selected individuals. The following instructions

More information

Let us fix it. Here s how we ll sort things out

Let us fix it. Here s how we ll sort things out Let us fix it Here s how we ll sort things out Tell us what went wrong We re sorry things didn t work out. We always try to give you the best possible service, but sometimes we don t always get it right.

More information

COSC 236 Section 101 Computer Science 1 -- Prof. Michael A. Soderstrand

COSC 236 Section 101 Computer Science 1 -- Prof. Michael A. Soderstrand COSC 236 Section 101 Computer Science 1 -- Prof. Michael A. Soderstrand COSC 236 Web Site You will always find the course material at: http://www.class-notes.us From this site you can click on the COSC-236

More information

Pe h-ōe-jī Unicode Correspondence Table

Pe h-ōe-jī Unicode Correspondence Table Pe h-ōe-jī Correspondence Table This document contains the code points and font examples for characters needed to write Pe h-ōe-jī for Taiwanese (Hoklo). Standard latin capital and small letters are not

More information

The DAG Model; Analysis of For-Loops; Reduction

The DAG Model; Analysis of For-Loops; Reduction CSE341T 09/06/2017 Lecture 3 The DAG Model; Analysis of For-Loops; Reduction We will now formalize the DAG model. We will also see how parallel for loops are implemented and what are reductions. 1 The

More information

Comp 11 Lectures. Mike Shah. June 26, Tufts University. Mike Shah (Tufts University) Comp 11 Lectures June 26, / 57

Comp 11 Lectures. Mike Shah. June 26, Tufts University. Mike Shah (Tufts University) Comp 11 Lectures June 26, / 57 Comp 11 Lectures Mike Shah Tufts University June 26, 2017 Mike Shah (Tufts University) Comp 11 Lectures June 26, 2017 1 / 57 Please do not distribute or host these slides without prior permission. Mike

More information

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #16 Loops: Matrix Using Nested for Loop

Introduction to Programming in C Department of Computer Science and Engineering. Lecture No. #16 Loops: Matrix Using Nested for Loop Introduction to Programming in C Department of Computer Science and Engineering Lecture No. #16 Loops: Matrix Using Nested for Loop In this section, we will use the, for loop to code of the matrix problem.

More information

DBMS Query evaluation

DBMS Query evaluation Data Management for Data Science DBMS Maurizio Lenzerini, Riccardo Rosati Corso di laurea magistrale in Data Science Sapienza Università di Roma Academic Year 2016/2017 http://www.dis.uniroma1.it/~rosati/dmds/

More information

Iteration. CSE / ENGR 142 Programming I. Chapter 5. Motivating Loops. One More Type of Control Flow. What s Wrong with HW1?

Iteration. CSE / ENGR 142 Programming I. Chapter 5. Motivating Loops. One More Type of Control Flow. What s Wrong with HW1? CSE / ENGR 142 Programming I Iteration Chapter 5 Read Sections 5.1-5.6, 5.10 5.1 Introduction & While Statement 5.2 While example 5.3 For Loop 5.4 Looping with a fixed bound 5.5 Loop design 5.6 Nested

More information

Lecture Transcript While and Do While Statements in C++

Lecture Transcript While and Do While Statements in C++ Lecture Transcript While and Do While Statements in C++ Hello and welcome back. In this lecture we are going to look at the while and do...while iteration statements in C++. Here is a quick recap of some

More information

Equations of planes in

Equations of planes in Roberto s Notes on Linear Algebra Chapter 6: Lines, planes and other straight objects Section Equations of planes in What you need to know already: What vectors and vector operations are. What linear systems

More information

Activity 6: Loops. Content Learning Objectives. Process Skill Goals

Activity 6: Loops. Content Learning Objectives. Process Skill Goals Activity 6: Loops Computers are often used to perform repetitive tasks. Running the same statements over and over again, without making any mistakes, is something that computers do very well. Content Learning

More information

Sql Server Syllabus. Overview

Sql Server Syllabus. Overview Sql Server Syllabus Overview This SQL Server training teaches developers all the Transact-SQL skills they need to create database objects like Tables, Views, Stored procedures & Functions and triggers

More information

Intermediate Algebra. Gregg Waterman Oregon Institute of Technology

Intermediate Algebra. Gregg Waterman Oregon Institute of Technology Intermediate Algebra Gregg Waterman Oregon Institute of Technology c 2017 Gregg Waterman This work is licensed under the Creative Commons Attribution 4.0 International license. The essence of the license

More information

Confirming your identity

Confirming your identity Overseas customers Confirming your identity We want to pay you quickly and securely To keep you safe from identity theft and fraud, we sometimes need to check that you are who you say you are. This is

More information

Chapter 19. Sorting Networks Model of Computation. By Sariel Har-Peled, December 17,

Chapter 19. Sorting Networks Model of Computation. By Sariel Har-Peled, December 17, Chapter 19 Sorting Networks By Sariel Har-Peled, December 17, 2012 1 19.1 Model of Computation It is natural to ask if one can perform a computational task considerably faster by using a different architecture

More information

Confirming your identity

Confirming your identity Confirming your identity We want to pay you quickly and securely To keep you safe from identity theft and fraud, we sometimes need to check that you are who you say you are. This is also required by anti-money

More information

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG) SKILL AREA 304: Review Programming Language Concept Computer Programming (YPG) 304.1 Demonstrate an Understanding of Basic of Programming Language 304.1.1 Explain the purpose of computer program 304.1.2

More information

Building Java Programs

Building Java Programs Building Java Programs Chapter 2 Lecture 2-2: The for Loop reading: 2.3 1 2 Repetition with for loops So far, repeating a statement is redundant: System.out.println("Homer says:"); System.out.println("I

More information

Computer Programming. Basic Control Flow - Loops. Adapted from C++ for Everyone and Big C++ by Cay Horstmann, John Wiley & Sons

Computer Programming. Basic Control Flow - Loops. Adapted from C++ for Everyone and Big C++ by Cay Horstmann, John Wiley & Sons Computer Programming Basic Control Flow - Loops Adapted from C++ for Everyone and Big C++ by Cay Horstmann, John Wiley & Sons Objectives To learn about the three types of loops: while for do To avoid infinite

More information

LOOPS. Repetition using the while statement

LOOPS. Repetition using the while statement 1 LOOPS Loops are an extremely useful feature in any programming language. They allow you to direct the computer to execute certain statements more than once. In Python, there are two kinds of loops: while

More information

The Maze Runner. Alexander Kirillov

The Maze Runner. Alexander Kirillov The Maze Runner URL: http://sigmacamp.org/mazerunner E-mail address: shurik179@gmail.com Alexander Kirillov This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License.

More information

Building Java Programs

Building Java Programs Building Java Programs Chapter 2 Lecture 2-2: The for Loop reading: 2.3 1 Repetition with for loops So far, repeating a statement is redundant: System.out.println("Homer says:"); System.out.println("I

More information

Analog Clock. High School Math Alignment. Level 2 CSTA Alignment. Description

Analog Clock. High School Math Alignment. Level 2 CSTA Alignment. Description Analog Clock High School Math Alignment Domain: Geometry Cluster: Apply geometric concepts in modelling situations Standard: CCSS.MATH.CONTENT.HSG.MG.A.1 Use geometric shapes, their measures, and their

More information

Making things better. Here s how to let us know about any problems

Making things better. Here s how to let us know about any problems Making things better Here s how to let us know about any problems We re sorry something went wrong Please tell us what happened so we can fix it We always try to give you the best possible service, but

More information

Unit 1, Lesson 1: Moving in the Plane

Unit 1, Lesson 1: Moving in the Plane Unit 1, Lesson 1: Moving in the Plane Let s describe ways figures can move in the plane. 1.1: Which One Doesn t Belong: Diagrams Which one doesn t belong? 1.2: Triangle Square Dance m.openup.org/1/8-1-1-2

More information

CS125 : Introduction to Computer Science. Lecture Notes #6 Compound Statements, Scope, and Advanced Conditionals

CS125 : Introduction to Computer Science. Lecture Notes #6 Compound Statements, Scope, and Advanced Conditionals CS125 : Introduction to Computer Science Lecture Notes #6 Compound Statements, Scope, and Advanced Conditionals c 2005, 2004, 2003, 2002, 2001, 2000 Jason Zych 1 Lecture 6 : Compound Statements, Scope,

More information

Functional Skills ICT Level 1 - Sample assessment Fishing Club. Total time available: 2 hours

Functional Skills ICT Level 1 - Sample assessment Fishing Club. Total time available: 2 hours Functional Skills ICT Level 1 - Sample assessment 3748-024 Fishing Club www.cityandguilds.com September 2011 Version 1.0 For examiner s use only Candidate Name (First, Middle, Last) Question Mark Part

More information

Lesson 1: Writing Your First JavaScript

Lesson 1: Writing Your First JavaScript JavaScript 101 1-1 Lesson 1: Writing Your First JavaScript OBJECTIVES: In this lesson you will be taught how to Use the tag Insert JavaScript code in a Web page Hide your JavaScript

More information

You just told Matlab to create two strings of letters 'I have no idea what I m doing' and to name those strings str1 and str2.

You just told Matlab to create two strings of letters 'I have no idea what I m doing' and to name those strings str1 and str2. Chapter 2: Strings and Vectors str1 = 'this is all new to me' str2='i have no clue what I am doing' str1 = this is all new to me str2 = I have no clue what I am doing You just told Matlab to create two

More information

D 2 L Quickguide: Discussions Overview

D 2 L Quickguide: Discussions Overview D 2 L Quickguide: Discussions Overview Discussions can be used to encourage peer interaction and conversations in your course. In discussions, students interact with one another by posting messages (called

More information

BIOE 198MI Biomedical Data Analysis. Spring Semester Dynamic programming: finding the shortest path

BIOE 198MI Biomedical Data Analysis. Spring Semester Dynamic programming: finding the shortest path BIOE 98MI Biomedical Data Analysis. Spring Semester 09. Dynamic programming: finding the shortest path Page Problem Statement: we re going to learn how to convert real life problem into a graphical diagram

More information

WakeMyPC Operations Guide Revision 5.2 January 2018

WakeMyPC Operations Guide Revision 5.2 January 2018 WakeMyPC Operations Guide Revision 5.2 January 2018 Contents Overview... 2 What is Wake-on-LAN?... 2 PC/Windows - Configuring your PC for Wake-On-LAN... 3 Initial BIOS and Windows Configuration... 3 Manual

More information

EGR 111 Loops. This lab is an introduction to loops, which allow MATLAB to repeat commands a certain number of times.

EGR 111 Loops. This lab is an introduction to loops, which allow MATLAB to repeat commands a certain number of times. EGR 111 Loops This lab is an introduction to loops, which allow MATLAB to repeat commands a certain number of times. New MATLAB commands: for, while,, length 1. The For Loop Suppose we want print a statement

More information

Program Analysis: A Hierarchy

Program Analysis: A Hierarchy 0/13 Workshop on Dynamic Analysis, Portland, Oregon, 2003 Program Analysis: A Hierarchy Andreas Zeller Lehrstuhl Softwaretechnik Universität des Saarlandes, Saarbrücken A Hierarchy of Reasoning 1/13 Experimentation

More information

OrbBasic Lesson 1 Goto and Variables: Student Guide

OrbBasic Lesson 1 Goto and Variables: Student Guide OrbBasic Lesson 1 Goto and Variables: Student Guide Sphero MacroLab is a really cool app to give the Sphero commands, but it s limited in what it can do. You give it a list of commands and it starts at

More information

Programming Languages

Programming Languages Programming Languages Recitation Summer 2014 Recitation Leader Joanna Gilberti Email: jlg204@cs.nyu.edu Office: WWH, Room 328 Web site: http://cims.nyu.edu/~jlg204/courses/pl/index.html Homework Submission

More information

OrbBasic 1: Student Guide

OrbBasic 1: Student Guide OrbBasic 1: Student Guide Sphero MacroLab is a really cool app to give the Sphero commands, but it s limited in what it can do. You give it a list of commands and it starts at the top and goes to the bottom,

More information

Dropbox links trade Dropbox Dropbox

Dropbox links trade Dropbox Dropbox Dropbox links trade If you are looking for something, send me a similar Dropbox or a description. No promises. idoontkn0w:. Pyt Trade Link Black Teen Dropbox. Trade pyt teen. Dropbox is a file hosting

More information

Access 2013: Intermediate to advanced queries

Access 2013: Intermediate to advanced queries Access 2013: Intermediate to advanced queries Practical workbook Aims and Learning Objectives This document shows you how to do things with queries that take you slightly beyond the norm. It is not supposed

More information

To become familiar with array manipulation, searching, and sorting.

To become familiar with array manipulation, searching, and sorting. ELECTRICAL AND COMPUTER ENGINEERING 06-88-211: COMPUTER AIDED ANALYSIS LABORATORY EXPERIMENT #2: INTRODUCTION TO ARRAYS SID: OBJECTIVE: SECTIONS: Total Mark (out of 20): To become familiar with array manipulation,

More information

Multiple-Subscripted Arrays

Multiple-Subscripted Arrays Arrays in C can have multiple subscripts. A common use of multiple-subscripted arrays (also called multidimensional arrays) is to represent tables of values consisting of information arranged in rows and

More information

(Refer Slide Time: 00:26)

(Refer Slide Time: 00:26) Programming, Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science and Engineering Indian Institute Technology, Madras Module 07 Lecture 07 Contents Repetitive statements

More information

Formal Model. Figure 1: The target concept T is a subset of the concept S = [0, 1]. The search agent needs to search S for a point in T.

Formal Model. Figure 1: The target concept T is a subset of the concept S = [0, 1]. The search agent needs to search S for a point in T. Although this paper analyzes shaping with respect to its benefits on search problems, the reader should recognize that shaping is often intimately related to reinforcement learning. The objective in reinforcement

More information

CS40-S13: Functional Completeness

CS40-S13: Functional Completeness CS40-S13: Functional Completeness Victor Amelkin victor@cs.ucsb.edu April 12, 2013 In class, we have briefly discussed what functional completeness means and how to prove that a certain system (a set)

More information

INTRODUCTION TO C++ PROGRAM CONTROL. Dept. of Electronic Engineering, NCHU. Original slides are from

INTRODUCTION TO C++ PROGRAM CONTROL. Dept. of Electronic Engineering, NCHU. Original slides are from INTRODUCTION TO C++ PROGRAM CONTROL Original slides are from http://sites.google.com/site/progntut/ Dept. of Electronic Engineering, NCHU Outline 2 Repetition Statement for while do.. while break and continue

More information

Repetition Structures II

Repetition Structures II Lecture 9 Repetition Structures II For and do-while loops CptS 121 Summer 2016 Armen Abnousi Types of Control Structures Sequential All programs that we have written so far The statements inside a pair

More information

Rotherhan Scouts Kindly produced as exemplar by Gillian Hemmings Wales High School Sheffield

Rotherhan Scouts Kindly produced as exemplar by Gillian Hemmings Wales High School Sheffield Rotherhan Scouts Kindly produced as exemplar by Gillian Hemmings Wales High School Sheffield Background Data processing activities within the organization. Description of the organisation Candidates should

More information

Polar Coordinates. 2, π and ( )

Polar Coordinates. 2, π and ( ) Polar Coordinates Up to this point we ve dealt exclusively with the Cartesian (or Rectangular, or x-y) coordinate system. However, as we will see, this is not always the easiest coordinate system to work

More information

Chapter 4: Programming with MATLAB

Chapter 4: Programming with MATLAB Chapter 4: Programming with MATLAB Topics Covered: Programming Overview Relational Operators and Logical Variables Logical Operators and Functions Conditional Statements For Loops While Loops Debugging

More information

Chapter 7 File Access. Chapter Table of Contents

Chapter 7 File Access. Chapter Table of Contents Chapter 7 File Access Chapter Table of Contents OVERVIEW...105 REFERRING TO AN EXTERNAL FILE...105 TypesofExternalFiles...106 READING FROM AN EXTERNAL FILE...107 UsingtheINFILEStatement...107 UsingtheINPUTStatement...108

More information

8.G Reflections, Rotations, and

8.G Reflections, Rotations, and 8.G Reflections, Rotations, and Translations Alignments to Content Standards: 8.G.A.1 Task In this task, using computer software, you will apply reflections, rotations, and translations to a triangle.

More information

Nesting. Abstraction & Nesting. Example. if x is less than y output x is smaller else output y is smaller. CS256 Computer Science I Kevin Sahr, PhD

Nesting. Abstraction & Nesting. Example. if x is less than y output x is smaller else output y is smaller. CS256 Computer Science I Kevin Sahr, PhD CS256 Computer Science I Kevin Sahr, PhD Lecture 19: Nested Conditionals and Loops 1 Nesting remember that conditional statements and loops contain single statements (or single block statements) this statement

More information

Dynamic programming II - The Recursion Strikes Back

Dynamic programming II - The Recursion Strikes Back Chapter 5 Dynamic programming II - The Recursion Strikes Back By Sariel Har-Peled, December 17, 2012 1 Version: 0.4 No, mademoiselle, I don t capture elephants. I content myself with living among them.

More information

Beginning and Intermediate Algebra Chapter 0: Arithmetic

Beginning and Intermediate Algebra Chapter 0: Arithmetic Beginning and Intermediate Algebra Chapter 0: Arithmetic An open source (CC-BY) textbook by Tyler Wallace 1 ? Beginning and Intermediate Algebra by Tyler Wallace is licensed under a Creative Commons Attribution

More information

Functional Programming in Haskell Prof. Madhavan Mukund and S. P. Suresh Chennai Mathematical Institute

Functional Programming in Haskell Prof. Madhavan Mukund and S. P. Suresh Chennai Mathematical Institute Functional Programming in Haskell Prof. Madhavan Mukund and S. P. Suresh Chennai Mathematical Institute Module # 02 Lecture - 03 Characters and Strings So, let us turn our attention to a data type we have

More information

Precalculus An Investigation of Functions

Precalculus An Investigation of Functions Precalculus An Investigation of Functions David Lippman Melonie Rasmussen Edition 1.3 This book is also available to read free online at http://www.opentextbookstore.com/precalc/ If you want a printed

More information

JackBytes. A simple, free, opensource server for relaying sound information. Robert Atwood. Piksel07.

JackBytes. A simple, free, opensource server for relaying sound information. Robert Atwood. Piksel07. A simple, free, opensource server for relaying sound information 1 Department of Jack Bytes www.jackbytes.net Piksel07 Outline Motivation 1 Dependencies Interface 2 3 Philosopical, Political,... Certain

More information

Loops and Files. of do-while loop

Loops and Files. of do-while loop L E S S O N S E T 5 Loops and Files PURPOSE PROCEDURE 1. To introduce counter and event controlled loops 2. To work with the while loop 3. To introduce the do-while loop 4. To work with the for loop 5.

More information

JANET Netsight Reporting Path Scenarios

JANET Netsight Reporting Path Scenarios i JANET Netsight Scenarios Revision History Author Issue Date Description Mark Leese V1.R1.M0 16-Jul-2009 First draft Mark Leese V1.R2.M0 28-Jul-2009 First official draft Luke Woodward V1.R2.M1 22-Nov-2013

More information

1 The sorting problem

1 The sorting problem Lecture 6: Sorting methods - The sorting problem - Insertion sort - Selection sort - Bubble sort 1 The sorting problem Let us consider a set of entities, each entity having a characteristics whose values

More information

Test design: Part I. Software Testing: INF3121 / INF4121

Test design: Part I. Software Testing: INF3121 / INF4121 Test design: Part I Software Testing: INF3121 / INF4121 Summary: Week 4 Test development process Analysis / Design / Implementation Categories of test design techniques Static / Dynamic Specification-based

More information

Introduction to Homogeneous coordinates

Introduction to Homogeneous coordinates Last class we considered smooth translations and rotations of the camera coordinate system and the resulting motions of points in the image projection plane. These two transformations were expressed mathematically

More information

-Using Excel- *The columns are marked by letters, the rows by numbers. For example, A1 designates row A, column 1.

-Using Excel- *The columns are marked by letters, the rows by numbers. For example, A1 designates row A, column 1. -Using Excel- Note: The version of Excel that you are using might vary slightly from this handout. This is for Office 2004 (Mac). If you are using a different version, while things may look slightly different,

More information

Instructions 1 Elevation of Privilege Instructions

Instructions 1 Elevation of Privilege Instructions Instructions 1 Elevation of Privilege Instructions Draw a diagram of the system you want to threat model before you deal the cards. Deal the deck to 3-6 players. Play starts with the 3 of Tampering. Play

More information

Quick Guide to Setup and Documents

Quick Guide to Setup and Documents Quick Guide to Setup and Documents Table of Contents I. Login to Moodle... 2 II. Moodle: Instructor s Course View... 2 III. Administration Panel... 3 IV. Course Settings... 4 V. Edit View... 5 1. Moodle

More information

Review. Modules. CS 151 Review #6. Sample Program 6.1a:

Review. Modules. CS 151 Review #6. Sample Program 6.1a: Review Modules A key element of structured (well organized and documented) programs is their modularity: the breaking of code into small units. These units, or modules, that do not return a value are called

More information

Parallel Algorithms CSE /22/2015. Outline of this lecture: 1 Implementation of cilk for. 2. Parallel Matrix Multiplication

Parallel Algorithms CSE /22/2015. Outline of this lecture: 1 Implementation of cilk for. 2. Parallel Matrix Multiplication CSE 539 01/22/2015 Parallel Algorithms Lecture 3 Scribe: Angelina Lee Outline of this lecture: 1. Implementation of cilk for 2. Parallel Matrix Multiplication 1 Implementation of cilk for We mentioned

More information

Matrices 4: use of MATLAB

Matrices 4: use of MATLAB Matrices 4: use of MATLAB Anthony Rossiter http://controleducation.group.shef.ac.uk/indexwebbook.html http://www.shef.ac.uk/acse Department of Automatic Control and Systems Engineering Introduction The

More information

Introduction to Geometry

Introduction to Geometry Introduction to Geometry Objective A: Problems involving lines and angles Three basic concepts of Geometry are: Points are a single place represented by a dot A Lines are a collection of points that continue

More information

OrbBasic LESSON 1 Goto and Variables Student Guide

OrbBasic LESSON 1 Goto and Variables Student Guide OrbBasic LESSON 1 Goto and Variables Student Guide What is OrbBasic? OrbBasic is a programming language. A programming language is a list of instructions that tells a computer what to do. Although MacroLab

More information

Alverton Community Primary School

Alverton Community Primary School Year 1 I can tell an adult if I see anything worrying online. I can give instructions to my friend and follow their instructions to move around. I can describe what happens when I press buttons on a robot.

More information

ECE 102 Engineering Computation

ECE 102 Engineering Computation ECE 102 Engineering Computation Phillip Wong MATLAB Loops for while break / continue Loops A loop changes the execution flow in a program. What happens in a loop? For each iteration of the loop, statements

More information

BEPI USER MANUAL. As with any programming, examples are invaluable and these can be downloaded from the EMACSYS web site at

BEPI USER MANUAL. As with any programming, examples are invaluable and these can be downloaded from the EMACSYS web site at BEPI USER MANUAL General This manual is intended for those with little or no experience of programming. More experienced programmers may prefer to refer to a shorter document BEPI for Programmers. As with

More information

2. BOOLEAN ALGEBRA 2.1 INTRODUCTION

2. BOOLEAN ALGEBRA 2.1 INTRODUCTION 2. BOOLEAN ALGEBRA 2.1 INTRODUCTION In the previous chapter, we introduced binary numbers and binary arithmetic. As you saw in binary arithmetic and in the handling of floating-point numbers, there is

More information

Proving the validity and accessibility of dynamic web pages

Proving the validity and accessibility of dynamic web pages Loughborough University Institutional Repository Proving the validity and accessibility of dynamic web pages This item was submitted to Loughborough University's Institutional Repository by the/an author.

More information

CSc 372. Comparative Programming Languages. 15 : Haskell List Comprehension. Department of Computer Science University of Arizona

CSc 372. Comparative Programming Languages. 15 : Haskell List Comprehension. Department of Computer Science University of Arizona 1/20 CSc 372 Comparative Programming Languages 15 : Haskell List Comprehension Department of Computer Science University of Arizona collberg@gmail.com Copyright c 2013 Christian Collberg 2/20 List Comprehensions

More information

ENGR 1181 MATLAB 09: For Loops 2

ENGR 1181 MATLAB 09: For Loops 2 ENGR 1181 MATLAB 09: For Loops Learning Objectives 1. Use more complex ways of setting the loop index. Construct nested loops in the following situations: a. For use with two dimensional arrays b. For

More information

While Loops CHAPTER 5: LOOP STRUCTURES. While Loops. While Loops 2/7/2013

While Loops CHAPTER 5: LOOP STRUCTURES. While Loops. While Loops 2/7/2013 While Loops A loop performs an iteration or repetition A while loop is the simplest form of a loop Occurs when a condition is true CHAPTER 5: LOOP STRUCTURES Introduction to Computer Science Using Ruby

More information

Netsight. End User Guide. Revision History. Author Issue Date Description. Andrew Longmore V1.R1.M0 12-Jun-2009 First draft

Netsight. End User Guide. Revision History. Author Issue Date Description. Andrew Longmore V1.R1.M0 12-Jun-2009 First draft Revision History Author Issue Date Description Andrew Longmore V1.R1.M0 12-Jun-2009 First draft Andrew Longmore V1.R1.M1 29-Jun-2009 Minor improvements to layout etc. Luke Woodward V1.R1.M2 14-Aug-2009

More information

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras

Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Advanced Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Lecture 28 Chinese Postman Problem In this lecture we study the Chinese postman

More information

Hypercubes in Four-Dimensional Space

Hypercubes in Four-Dimensional Space Chapter 13 Hypercubes in Four-Dimensional Space What is the fourth dimension? No, it s not time. Well, maybe it is if you re studying physics. Even then, we have certain intuitive ideas about how time

More information

ADVANCED DATABASE Syllabus Version 2.0

ADVANCED DATABASE Syllabus Version 2.0 ECDL MODULE ADVANCED DATABASE Syllabus Version 2.0 Purpose This document details the syllabus for the Advanced Database module. The syllabus describes, through learning outcomes, the knowledge and skills

More information

Using Flickr Storm for locating imagery for digital storytelling projects

Using Flickr Storm for locating imagery for digital storytelling projects Using Flickr Storm for locating imagery for digital storytelling projects David Jakes, dave@jakesonline.org To begin, create a folder on your computer where you will store images. 1. Login to Flickr Storm

More information

Getting started with SimaPro Share

Getting started with SimaPro Share Title: Written by: Getting started with SimaPro Share PRé Consultants Report version: 2 Date: May 2018 Copyright: 2002-2018 PRé. Some rights reserved. This work is licensed under the Creative Commons Attribution-

More information