IT1005 Lab session on week 6 (2 nd meeting). Lab 2 - Recap By now, you must ensure that you are familiar with Matlab environments: – Matlab main window,

Slides:



Advertisements
Similar presentations
Debugging ACL Scripts.
Advertisements

Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Introduction to Programming using Matlab Session 2 P DuffourJan 2008.
Answer "What If" Questions
COMP 116: Introduction to Scientific Programming Lecture 37: Final Review.
Lecture 4.
Using Excel Biostatistics 212 Lecture 4. Housekeeping Questions about Lab 3? –replace vs. recode Final Project Dataset! –“Housekeeping” commands vs. data.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Why care about debugging? How many of you have written a program that worked perfectly the first time? No one (including me!) writes a program that works.
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
IT1005 Lab session on week 5. About your Lab TA Name: Steven Halim (Indonesian) Occupation: – Full time teaching assistant – Part time PhD student Not.
3.1 Data and Information –The rapid development of technology exposes us to a lot of facts and figures every day. –Some of these facts are not very meaningful.
Lecture 10: Sensitivity Part I: General AGEC 352 Spring 2011 – February 28 R. Keeney.
General Computer Science for Engineers CISC 106 Lecture 21 Dr. John Cavazos Computer and Information Sciences 04/10/2009.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 14 – Student Grades Application: Introducing.
Computer Science in Practice This course is an introduction to problems (and solutions) that arise in applied fields of computer science such as machine.
EGR 106 – Week 2 – Arrays Definition, size, and terminology Construction methods Addressing and sub-arrays Some useful functions for arrays Character arrays.
Precedence Parentheses Arithemetic ^ * / + - (exception logical not ~ ) Relational > =
EGR 106 – Week 2 – Arrays & Scripts Brief review of last week Arrays: – Concept – Construction – Addressing Scripts and the editor Audio arrays Textbook.
Concatenation MATLAB lets you construct a new vector by concatenating other vectors: – A = [B C D... X Y Z] where the individual items in the brackets.
An Introduction to Computer Programming Anna Bretscher
Integrated Math III Essential Question What different methods can be used to solve quadratic equations?
January 24, 2005 Lecture 3 - By P. Lin 1 CPET 190 Lecture 3 Problem Solving with MATLAB
BETTER MANAGING OUR TIME KRONOS TIMEKEEPER SCHEDULING TRAINING YMCA OF METROPOLITAN DALLAS August 30, 2015.
Chapter 10 Review: Matrix Algebra
CS110/CS119 Introduction to Computing (Java)
THE MATLAB ENVIRONMENT VARIABLES BASIC COMMANDS HELP HP 100 – MATLAB Wednesday, 8/27/2014
COMP 111 Programming Languages 1 First Day. Course COMP111 Dr. Abdul-Hameed Assawadi Office: Room AS15 – No. 2 Tel: Ext. ??
Rounding and Estimating Create a magic number square This is where every row, column and diagonal add up to the same total. Eg Now design your own to.
U3A Computing Class Leader – Brian Moore Week 5 of 10 weeks. Mondays 4:15 to 5:45 pm Next week is half term then an Inset day So Next lesson is 4 November.
How to Run a Java Program CSE 1310 – Introduction to Computers and Programming Vassilis Athitsos University of Texas at Arlington 1.
Chapter 02 (Part III) Introduction to C++ Programming.
Introduction to MATLAB 7 Engineering 161 Engineering Practices II Joe Mixsell Spring 2010.
Key Words: Functional Skills. Key Words: Spreadsheets.
Synthesis ENGR 1181 MATLAB 11. Topics  No new material  Covers topics that will be on the Midterm 2 Exam MATLAB 01 – Program Design MATLAB 02 – Introduction.
Winter Semester 2014/2015 College of Engineering.
Structured Programming: Debugging and Practice by the end of this class you should be able to: debug a program using echo printing debug a program using.
Mark Dixon Page 1 04 – Information Processing: Expressions, Operators & Functions.
Introduction to MATLAB Session 1 Simopekka Vänskä, THL 2010.
CS161 Topic #16 1 Today in CS161 Lecture #16 Prepare for the Final Reviewing all Topics this term Variables If Statements Loops (do while, while, for)
Chapter 6 Review: User Defined Functions Introduction to MATLAB 7 Engineering 161.
IT1005 Lab session on week 7 (3 rd meeting) Welcome back from Mid semester break =) (a. k. a Mid test period)
1 Debugging and Syntax Errors in C++. 2 Debugging – a process of finding and fixing bugs (errors or mistakes) in a computer program.
CS1109 L AB 3 July 3rd. R OAD M AP Homework submission Review How to use function and scripts While-end Finish last exercise Lab 2 Challenge questions.
Hello Mr. Anderson… We’ve been waiting for you.. Hello Mr. Anderson… We’ve been waiting for you.
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.
A simple classification problem Extract attributes Pattern Pattern recognition decision x C1 C2.
Introduction to MATLAB 7 Engineering 161 Engineering Practices II Joe Mixsell Spring 2012.
Online Catalog Tutorial. Introduction Welcome to the Online Catalog Tutorial. This is the place to find answers to all of your online shopping questions.
Overview Excel is a spreadsheet, a grid made from columns and rows. It is a software program that can make number manipulation easy and somewhat painless.
Copyright © Curt Hill Loop Types and Construction Logical types and construction hints.
INTRODUCTION TO MATLAB DAVID COOPER SUMMER Course Layout SundayMondayTuesdayWednesdayThursdayFridaySaturday 67 Intro 89 Scripts 1011 Work
PROGRAMMING IN PYTHON LETS LEARN SOME CODE TOGETHER!
Intro to Loops 1.General Knowledge 2.Two Types of Loops 3.The WHILE loop 1.
Course Information CSE 2031 Fall Instructor U. T. Nguyen /new-yen/ Office: CSEB Office hours:  Tuesday,
Manipulating MATLAB Vector, Matrices 1. Variables and Arrays What are variables? You name the variables (as the programmer) and assign them numerical.
Introduction to Blackboard Rabie A. Ramadan Session 3.
Course Information CSE 2031 Fall Instructor U.T. Nguyen Office: CSE Home page:
Debugging M-Files Steve Gu Feb 08, Outline What’s Debugging? Types of Errors Finding Errors Debugging Example Using Debugging Features.
Get Organized Binders, Homework, Lockers. Binder Organization Use a binder system that works best for you Put you name, address and phone number on the.
Matlab Training Session 4: Control, Flow and Functions
Introduction to Programming for Mechanical Engineers (ME 319)
CS1010 Discussion Group 11 Week 7 – Two dimensional arrays.
Introduction to Computers and their Applications
Introduction to Computer Programming
Agenda for Unit 5: Control Structures
Module 4 Loops and Repetition 9/19/2019 CSE 1321 Module 4.
Presentation transcript:

IT1005 Lab session on week 6 (2 nd meeting)

Lab 2 - Recap By now, you must ensure that you are familiar with Matlab environments: – Matlab main window, M-File Editor, Command Window, Workspace, Figure Window, Docking, etc. – Matlab debugger, breakpoint, stepping functions, looking at workspace during stepping, ‘go to cursor’, adjusting program based on the error messages, etc. Remember that you can always just select Matlab codes using ‘Select tool’ in Adobe Acrobat, then do copy-paste to Matlab rather than typing it all again. – For lab assignments, for trying codes in lecture notes, etc.

Symbols and Keyboard Locations SymbolEnglish NameKeyboard LocationMatlab example :ColonSHIFT+two keys on the left of [Enter]A = 1:5 ;SemicolonTwo keys on the left of [Enter]A = [1;2;3] `Apostrophe 1One key on the left of key 1NOT valid! ‘Apostrophe 2One key on the left of [Enter]A = ‘hello’ []Square bracketAbove [Enter]A = [1 2 3] &AmpersandSHIFT+key 7true && true |BarSHIFT+one key above [ENTER]false || true ~TildeSHIFT+one key one the left of key 1~ false The other keys should be quite straightforward…

Review on Array/Vector/Matrix Creation – mat = [], repmat, ones, zeros, eye, diag, rand, etc Accessing elements/indexing (index start from 1!) – mat(indices), the usage of ‘:’, mat([indices 1 … indices n ]) Manipulation: add, edit, delete row/col, sort, find – mat(:,x) = y Operation: +, -, *, /,.*,./ – matA op matB, mat op scalar (scalar expansion) Multidimensional array: 3-D… – We seldom go beyond 3D…

Quick Test Simple test to about array: 1.Create an array of size 4*5 with all ‘1’ (then all ‘0’). 1.Try repmat, manual creation, using [1;1;1;1]*[ ] =) 2.Compute this: [1 2].* [2 1] = [3 4] [2 1] 1.Change.* to *,./, /, +, or - 3.Create this array [1 2 3; 4 5 6; 7 8 9], then perform these operations: 1.Change the 2 nd row to ! 2.Change the 3 rd col to ! 3.Change the main diagonal to all zeros!

Relational and Logical Operations Matlab relational operations –, =, ==, ~= – relational operations on array  the result is array – floating-point imprecision  use eps Logical operators – &, |, ~, &&, || – short circuit

Quick Test Simple test to about relational/logical operations: – How to make these statements produce ans = 1 – You can only supply ONE single operator or MATLAB function to replace ‘…’ *2-5/4 … 2* sin(pi) == 0? 3.… ( [ ] / [1 2 3] ) 4.10 > … > 5 … 5 > 2 6.… … 10 > 20 && 5 < 2 …

Lab 3 – Free and Easy Time Now, you are free to explore Matlab, especially to find answers for Lab 3 For those who have done Lab 3, try this extra challenges! The solution is at the end of this session – There is a land of size 3m*5m – The height of each square meter on that land is known: [ ; ; ] above sea level (denoted in meter). – A house of size 3*5 is going to be built there. – Before building it, the land must be leveled! – We want the land to have height 5m above sea level. – Question: what is the minimum amount of soil (in cubic meter) that must be added (or perhaps removed) in order to make this land flat? – Hint: explore array operations, Matlab function ‘sum’, and ‘mesh’ or ‘surf’!

Lab 3 Marking + Midterm Test I will be away Jakarta, Indonesia during mid semester break – 22 Feb night – 2 March Lab 3 marks will be available on 3 or 4 March. – Will not be as fast as Lab 0/1 last week. If you have any questions, try IVLE forum first, ask your class mates, or ask Colin. – I will occasionally check my s from home, but will not be able to reply that fast! – Or ask on Monday morning, before your Mid-term exam!

Remember This! answers to: stevenhalim at gmail.com With subject header: – “IT1005-LabGroupID” “FullName”, e.g. IT1005-7A StevenHalim – Mr Gmail will sort your s for me =) Try to submit your answers ONCE – Do not submit again to fix some minor mistakes! Shorter (but correct) answers ~ better marks =) Remember, I have ~100 s/week !