ENGR 1181c Midterm Exam 2: Study Guide and Practice Problems

Size: px
Start display at page:

Download "ENGR 1181c Midterm Exam 2: Study Guide and Practice Problems"

Transcription

1 ENGR 1181c Midterm Exam 2: Study Guide and Practice Problems Disclaimer Problems seen in this study guide may resemble problems relating mainly to the pertinent homework assignments. Reading this study guide and solving the practice problems is not a sufficient level of studying for this exam. Students should also review the relevant reading material and PowerPoint slides as questions will be asked from those places as well. Please remember that the number of show your work practice problems exceeds the number of show your work exam problems. 50 Points Total Exam Specifications - 20 points multiple choice (~15 questions, 1-2 pts. each) o Done on Carmen using a lockdown browser o No other internet access is allowed. Those accessing the internet otherwise will be sent to COAM. Please review OSU s policy on academic misconduct. o Graded automatically and entered into Carmen points 2 show your work problems o Both problems will focus on MATLAB, you may need to fill in the blanks with code, or create a script file, or modify a script file. Always start your script files by displaying your name, seat number etc. and using close all; clear; clc o Make sure you assign a different name for each PDF file during the exam. o Do not use run section during the exam, it will not save your script file and your work will be lost! ALWAYS use run. - Calculators are not allowed. - The exam is closed book closed notes. - No communication with other students is allowed. Please review OSU s policy on academic misconduct. - No use of cell phones.

2 Content Review - Below is contained the content and learning objectives that will be tested on this exam. Not all learning objectives will be tested exactly as read, however students should use this material to keep track of what they need to be reviewing. 1. MATLAB a. Array Creation i. [a, b, c ; d, e, f] notation ii. [min : step : max] notation iii. linspace function iv. I/O Demonstrate proper usage of basic MATLAB features (e.g., the Command Window, script files, other default windows, arithmetic operations, assigning variables and names, built-in functions, help command) Demonstrate proper notation for accessing elements from previously assigned onedimensional arrays (e.g., single elements, list of elements) and two-dimensional arrays (e.g., those with rows and columns) b. Array Accessing i. Pure array accessing ii. Sub arrays iii. Using the colon operator Demonstrate proper notation for accessing elements from previously assigned onedimensional arrays (e.g., single elements, list of elements) and two-dimensional arrays (e.g., those with rows and columns) Explain that a string is a one dimensional array and can be used the same way as numeric arrays c. Array Operations (. Operators) Explain meaning of element-by-element operations Identify situations where the standard operators in MATLAB (when used with arrays) are reserved for linear algebra, which is not always element-by-element Apply dot operators for o The six cases where linear algebra is not element-by-element and therefore dot operators are needed to produce element-by-element calculations

3 d. MATLAB algebra syntax (conversion from math expression) Explain meaning of element-by-element operations Identify need to translate mathematical notation into proper MATLAB syntax e. Conditional Statements and logical operators Explain how conditional statements (e.g., if-end, if-else-end, switch-case) are used to make decisions Apply logical operations correctly in arrays Analyze data using logical operators. f. MATLAB looping Use more complex ways of setting the loop index Use loops to repeat a code with conditional statements 2. Labs continued a. Solar Meter Describe and build both a calibration and solar meter circuit Convert decimal values to binary values Compare a pictorial image of a circuit to a schematic wiring diagram b. Solar Cell Identify the advantages and disadvantages of solar cells. Calculate the efficiency of a solar cell. c. Beam Bending Employ the concepts of stress, strain, and Young's modulus for structural materials. Use the stress-strain equation to calculate how applied forces deform structures. Calculate the moment of inertia of various beam geometries. Determine how beam geometry affects the stiffness and strength of beams. Identify unknown beam material through analysis and calculation of Young s Modulus. Evaluate behavior of various beams based on material and shape. d. Wind Turbine part A Describe the relationship between velocity (of the wind) and pressure based on Bernoulli s Equation for incompressible flow. Calculate the power available in the wind and compare it to the power generated by a wind turbine. Summarize the characteristics of the wind tunnel and turbine.

4 Describe the relationship between velocity (of the wind) and pressure. Determine the power available in the wind. Relate the power available in the wind to the wind speed. Compare the power generated by a wind turbine to the power in the wind. Here is a syntax guide for help in reviewing. PRINTING AND BRINGING THIS TO THE EXAM IS NOT ALLOWED. MatLab Syntax Review Sheet FOR MIDTERM 2 RELEVANT INFORMATION ONLY Current Directory your current working directory with a list of m-files Workspace current list of MatLab variables and values Command History past commands that have been typed and executed Command Window where commands can be entered Editor Window where you write and run MatLab script files Don t forget that typing help into MATLAB will assist you with specific functions and is allowed during the exam show your work problems! MatLab Tips >> clc clear command window; does not clear memory >> cmd displays the result of a command in the command window >> cmd; does not display the result in the command window >> cmd1, cmd2 displays both results >> cmd1; cmd2 displays last result only clear clear x,y,z variable names clears ALL variables from memory clears only x, y, and z 1. must begin with a letter 2. are case sensitive contain letters, numbers, and _ math precedence... (ellipsis) up arrow down arrow highest ( ) ; ^ ; * / ; + - lowest 3. extends a command to the next line scrolls backward through previous commands scrolls forward through commands help abcd help on the subject "abcd" ( doc abcd -- works too )

5 Numeric Display Formats format short format long format short e format bank nnn.1234 nnn (14 decimal places) n.1234e+001 nnn.12 Input / Output Commands disp( ' any text ' ) fprintf('text = %i,%f',k,x) x = input( ' any text ' ) displays ' any text ' in the command window formatted output prints "Text = integer and fixed point" asks the user to enter a value for x from the keyboard 1-D Array (row and column vectors) scalar, s vector, v is a single number (a 1 x 1 array) is a 1 row x n column array a list of numbers v_list = [ a b c ] or = [ a, b, c ] row vector v_row = [ a b c ] or = [ a, b, c ] column vector v_col = [ a ; b ; c ] constant spacing v_space = [ first : space : last ] single spacing v_1space = [ first : last ] vector with n terms, evenly spaced v_nterms = linspace( first, last, n ) transpose of a vector value of the ith term v_col = v_row ' v(i) Addition / Subtraction z = x ± y z = [ xx 1 ± yy 1, xx 2 ± yy 2, xx 3 ± yy 3 ] Multiplication / Division z = x.* y and z = x. / y Exponents z = x.^ y z = [ xx 1. ^ yy 1, xx 2. ^ yy 2, eeeeee. ] max(v) or min (v) length(v) mean(v) or sum(v) Returns largest / smallest element of v Returns the length (# of elements) in vector v Returns average value / sum of elements in v 2-D Array (matrix) Matrix, A is an r (rows) X c (columns) array A( r, c ) is the value of the element ( r, c ) in A A( r, c ), in rows A = [ row1 ; row2 ; row3 ] A( r1:r2, c1:c2 ) retrieves values in row and column ranges Example: A(1:3, [1 4 6]) means rows 1-3 and columns 1,4,6 of matrix A

6 Logic Conditional and Relational Operators Less than / Greater than < / > Less than equal to / greater than equal to <= / >= Equal to / Not equal to == / ~= TRUE statement / FALSE statement 1 (or any non-zero number) / 0 & AND ( Example: A & B ) TRUE when A and B are both true OR ( Example: A B ) TRUE when either A is true or B is true ~ NOT ( Example: ~ A ) TRUE if A is false / FALSE if A is true Operator precedence ( high low ) ( ) ^ ~ */ + > < >= <= == ~= & Conditional Statements if conditional statement Works when there is only one command group Command Group end if conditional statement Command Group 1 else If the conditional statement is "True", then do "Command Group 1". It the conditional statement is "False", then do "Command Group 2". Command Group 2 end if ( conditional 1 ) do Command Group 1 elseif ( conditional 2 ) do Command Group 2 elseif ( conditional 3 ) do Command Group 3 else do Command Group 4 end "If elseif else end" When there are more than two command groups, you can use this form with elseif Elseif = if not the first, do the second, or if not the second, do the third, etc. The "else" never has a conditional and is optional.

7 Loops k = first : step : last Example of a loop in a script file: This loop calculates a new vector v2 from an existing vector v1. Note that the loop uses vector addressing. Loop index variable = first value : step size : last value v1 = [ 0 : 5 : 25 ] ; % Define the vector v1 for i = 1 : length (v1) % The step size is 1 % Each pass in the loop v2(i) = v1(i) ^ 2 ; % calculates a new element % in the vector v2 end disp(v2) Common Functions sqrt(x) exp(x) abs(x) log(x) log10(x) factorial(x) sin(x) / cos(x) / tan(x) sind(x) / cosd(x) / tand(x) round(x) fix(x) ceil(x) floor(x) rem(x,y) if rem(x,y) == 0 sign(x) square root of x ee xx = exponential function absolute value of x natural log of x log base 10 of x factorial function [ x! ], where x is a positive integer trig functions with angle in radians trig functions with angle in degrees Round to the nearest integer Round toward zero Round toward infinity Round toward negative infinity Equals the remainder of x divided by y Conditional test that is true when x is a multiple of y Signum function returns [1 if x>0], [-1 if x<0], [0 if x=0]

8 Practice Problems Problem 1: Work out Problem Use MATLAB to create a script file to accomplish the task described below. Run the script file for all three cases using a for loop. Save pdf files of both the script file and the command window. Write a script file to calculate distance traveled by a water balloon after asking the user for the initial speed and angle of launch. The program should determine the distance traveled by the following equation: DD = vv 0 2 sin(2θθ) gg mmmmmmmmmmmm Have the program output the distance traveled using fprintf. Use g = 9.81 m/s 2. The input cases are: Launch Number Initial Speed (m/s) Angle of Launch (degrees) Launch Launch Launch The script file should produce output for each launch that looks like: For Launch X the distance traveled was () meters Don t forget to start your script file with disp( Your Name, seat # )

9 Problem 2: Work out Problem Use MATLAB to create a script file to accomplish the task described below. Run the script file for all three cases using a for loop. Save pdf files of both the script file and the command window. Use your knowledge of circuits to write a MATLAB script file that calculates values for all three currents. Ask the user for the power supply and three resistor values for each run. Have the program output the three currents using fprintf. The input cases are: Power Supply (V) R1 (Ω) R2 (Ω) R3 (Ω) 12 V V V The script file should produce output for each power supply that looks like: For the power supply of () V: I1 was () A, I2 was () A, I3 was () A. Don t forget to start your script file with disp( Your Name, seat # )

10 Problem 3: Work out Problem Use MATLAB to create a script file to accomplish the task described below. Run the script file for all four cases using a for loop. Save pdf files of both the script file and the command window. Terminal Velocity is defined as the velocity at which an object falling through a fluid has its weight equal to the drag force on that object. Write a MATLAB script file to calculate terminal velocity of various objects falling in air. Ask the user to input the mass, drag coefficient and frontal area A of each object. Print each objects terminal velocity to the command window using fprintf. At the end of the program, use conditional statements to determine and print using fprintf to the command window which object has the fastest terminal velocity. VV tt = 2mmmm ρρρρcc dd Common Constants: g = 9.81 m/s 2, ρ air = 1.29 kg/m 3 The input cases are: Object m (kg) Cd (unitless) A (m 2 ) # # # # The script file should produce output for each object that looks like: For object #(): the terminal velocity was () m/s. The end of the program should produce an output that looks like: Object #() had the maximum terminal velocity of () m/s. Don t forget to start your script file with disp( Your Name, seat # )

11 1. The modulus of elasticity is defined as: a) The ratio of yield stress to strain (ys/ε) in the plastic region. b) The slope of strain to stress (ε/σ) in the elastic region. c) The slope of stress to strain (σ/ε) in the elastic region. d) The ratio of stress to strain (σ/ε) in the plastic region. e) The slope of stress to material stiffness (σ/e) in the elastic region. 2. Write the command to create a vector, X, starting at 50 and ending at 5 with values every 0.2, which displays the created vector in the command window. 3. What is the command to use a built-in system function to find the average of the vector X from question #1 above, assign the value to RESULT, and suppress output in the command window? 4. If C = [ ] and D = [7 8 9], what is the command to create a single row array X with the elements of C and D (afterwards X = [ ])? 5. Write the command to find the sine of 30? 6. The Solar Meter Lab used a Trim Pot (Trim Potentiometer) in the breadboard setup. When you turn the knob on the TrimPot, which variable is adjusted?

12 7. Given that x=[ ; ; ] has been assigned, what would be the result of y=x(2:3,[1 2 4])? 8. Write a single statement that prompts the user with 'Please enter the day of the week: ' Assign the results to a variable called 'today', suppressing any outputs to Command Window. 9. Given a 10 by 3 matrix M, write a single command that extracts all members of the 3 rd column of matrix M and assigns it to a vector called M_col_3 using the colon operator. 10. A vector x is defined in MATLAB by: x = [1:2:7]; Consider the equation: y = x2 (x+3) Write a MATLAB command that creates a vector y where each element has a value calculated by the equation with the corresponding element in the vector x.

ENGR 1181 Autumn 2015 Final Exam Study Guide and Practice Problems

ENGR 1181 Autumn 2015 Final Exam Study Guide and Practice Problems ENGR 1181 Autumn 2015 Final Exam Study Guide and Practice Problems Disclaimer Problems seen in this study guide may resemble problems relating mainly to the pertinent homework assignments. Reading this

More information

ENGR 1181 Midterm Exam 2: Study Guide and Practice Problems

ENGR 1181 Midterm Exam 2: Study Guide and Practice Problems ENGR 1181 Midterm Exam 2: Study Guide and Practice Problems Disclaimer Problems seen in this study guide may resemble problems relating mainly to the pertinent homework assignments. Reading this study

More information

No, not unless you specify in MATLAB which folder directory to look for it in, which is outside of the scope of this course.

No, not unless you specify in MATLAB which folder directory to look for it in, which is outside of the scope of this course. ENGR 1181 Midterm 2 Review Worksheet SOLUTIONS Note: This practice material does not contain actual test questions or represent the format of the midterm. The first 29 questions should be completed WITHOUT

More information

PROGRAMMING WITH MATLAB DR. AHMET AKBULUT

PROGRAMMING WITH MATLAB DR. AHMET AKBULUT PROGRAMMING WITH MATLAB DR. AHMET AKBULUT OVERVIEW WEEK 1 What is MATLAB? A powerful software tool: Scientific and engineering computations Signal processing Data analysis and visualization Physical system

More information

Welcome to EGR 106 Foundations of Engineering II

Welcome to EGR 106 Foundations of Engineering II Welcome to EGR 106 Foundations of Engineering II Course information Today s specific topics: Computation and algorithms MATLAB Basics Demonstrations Material in textbook chapter 1 Computation What is computation?

More information

Introduction to Engineering gii

Introduction to Engineering gii 25.108 Introduction to Engineering gii Dr. Jay Weitzen Lecture Notes I: Introduction to Matlab from Gilat Book MATLAB - Lecture # 1 Starting with MATLAB / Chapter 1 Topics Covered: 1. Introduction. 2.

More information

Quick MATLAB Syntax Guide

Quick MATLAB Syntax Guide Quick MATLAB Syntax Guide Some useful things, not everything if-statement Structure: if (a = = = ~=

More information

PART 1 PROGRAMMING WITH MATHLAB

PART 1 PROGRAMMING WITH MATHLAB PART 1 PROGRAMMING WITH MATHLAB Presenter: Dr. Zalilah Sharer 2018 School of Chemical and Energy Engineering Universiti Teknologi Malaysia 23 September 2018 Programming with MATHLAB MATLAB Environment

More information

Outline. CSE 1570 Interacting with MATLAB. Starting MATLAB. Outline. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An.

Outline. CSE 1570 Interacting with MATLAB. Starting MATLAB. Outline. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An. CSE 170 Interacting with MATLAB Instructor: Aijun An Department of Computer Science and Engineering York University aan@cse.yorku.ca Outline Starting MATLAB MATLAB Windows Using the Command Window Some

More information

Chapter 1 Introduction to MATLAB

Chapter 1 Introduction to MATLAB Chapter 1 Introduction to MATLAB 1.1 What is MATLAB? MATLAB = MATrix LABoratory, the language of technical computing, modeling and simulation, data analysis and processing, visualization and graphics,

More information

9 Using Equation Networks

9 Using Equation Networks 9 Using Equation Networks In this chapter Introduction to Equation Networks 244 Equation format 247 Using register address lists 254 Setting up an enable contact 255 Equations displayed within the Network

More information

Outline. CSE 1570 Interacting with MATLAB. Starting MATLAB. Outline (Cont d) MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An

Outline. CSE 1570 Interacting with MATLAB. Starting MATLAB. Outline (Cont d) MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An CSE 170 Interacting with MATLAB Instructor: Aijun An Department of Computer Science and Engineering York University aan@cse.yorku.ca Outline Starting MATLAB MATLAB Windows Using the Command Window Some

More information

Outline. CSE 1570 Interacting with MATLAB. Outline. Starting MATLAB. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An.

Outline. CSE 1570 Interacting with MATLAB. Outline. Starting MATLAB. MATLAB Windows. MATLAB Desktop Window. Instructor: Aijun An. CSE 10 Interacting with MATLAB Instructor: Aijun An Department of Computer Science and Engineering York University aan@cse.yorku.ca Outline Starting MATLAB MATLAB Windows Using the Command Window Some

More information

Introduction to MATLAB

Introduction to MATLAB ELG 3125 - Lab 1 Introduction to MATLAB TA: Chao Wang (cwang103@site.uottawa.ca) 2008 Fall ELG 3125 Signal and System Analysis P. 1 Do You Speak MATLAB? MATLAB - The Language of Technical Computing ELG

More information

Introduction to MatLab. Introduction to MatLab K. Craig 1

Introduction to MatLab. Introduction to MatLab K. Craig 1 Introduction to MatLab Introduction to MatLab K. Craig 1 MatLab Introduction MatLab and the MatLab Environment Numerical Calculations Basic Plotting and Graphics Matrix Computations and Solving Equations

More information

Matlab Programming Introduction 1 2

Matlab Programming Introduction 1 2 Matlab Programming Introduction 1 2 Mili I. Shah August 10, 2009 1 Matlab, An Introduction with Applications, 2 nd ed. by Amos Gilat 2 Matlab Guide, 2 nd ed. by D. J. Higham and N. J. Higham Starting Matlab

More information

Introduction to MATLAB

Introduction to MATLAB to MATLAB Spring 2019 to MATLAB Spring 2019 1 / 39 The Basics What is MATLAB? MATLAB Short for Matrix Laboratory matrix data structures are at the heart of programming in MATLAB We will consider arrays

More information

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing

SECTION 1: INTRODUCTION. ENGR 112 Introduction to Engineering Computing SECTION 1: INTRODUCTION ENGR 112 Introduction to Engineering Computing 2 Course Overview What is Programming? 3 Programming The implementation of algorithms in a particular computer programming language

More information

2.0 MATLAB Fundamentals

2.0 MATLAB Fundamentals 2.0 MATLAB Fundamentals 2.1 INTRODUCTION MATLAB is a computer program for computing scientific and engineering problems that can be expressed in mathematical form. The name MATLAB stands for MATrix LABoratory,

More information

Consider this m file that creates a file that you can load data into called rain.txt

Consider this m file that creates a file that you can load data into called rain.txt SAVING AND IMPORTING DATA FROM A DATA FILES AND PROCESSING AS A ONE DIMENSIONAL ARRAY If we save data in a file sequentially than we can call it back sequentially into a row vector. Consider this m file

More information

Starting Matlab. MATLAB Laboratory 09/09/10 Lecture. Command Window. Drives/Directories. Go to.

Starting Matlab. MATLAB Laboratory 09/09/10 Lecture. Command Window. Drives/Directories. Go to. Starting Matlab Go to MATLAB Laboratory 09/09/10 Lecture Lisa A. Oberbroeckling Loyola University Maryland loberbroeckling@loyola.edu http://ctx.loyola.edu and login with your Loyola name and password...

More information

ANSI C Programming Simple Programs

ANSI C Programming Simple Programs ANSI C Programming Simple Programs /* This program computes the distance between two points */ #include #include #include main() { /* Declare and initialize variables */ double

More information

Chapter 2. MATLAB Basis

Chapter 2. MATLAB Basis Chapter MATLAB Basis Learning Objectives:. Write simple program modules to implement single numerical methods and algorithms. Use variables, operators, and control structures to implement simple sequential

More information

Numerical Analysis First Term Dr. Selcuk CANKURT

Numerical Analysis First Term Dr. Selcuk CANKURT ISHIK UNIVERSITY FACULTY OF ENGINEERING and DEPARTMENT OF COMPUTER ENGINEERING Numerical Analysis 2017-2018 First Term Dr. Selcuk CANKURT selcuk.cankurt@ishik.edu.iq Textbook Main Textbook MATLAB for Engineers,

More information

Chapter 4: Basic C Operators

Chapter 4: Basic C Operators Chapter 4: Basic C Operators In this chapter, you will learn about: Arithmetic operators Unary operators Binary operators Assignment operators Equalities and relational operators Logical operators Conditional

More information

Boolean Logic & Branching Lab Conditional Tests

Boolean Logic & Branching Lab Conditional Tests I. Boolean (Logical) Operations Boolean Logic & Branching Lab Conditional Tests 1. Review of Binary logic Three basic logical operations are commonly used in binary logic: and, or, and not. Table 1 lists

More information

Chapter 2 (Part 2) MATLAB Basics. dr.dcd.h CS 101 /SJC 5th Edition 1

Chapter 2 (Part 2) MATLAB Basics. dr.dcd.h CS 101 /SJC 5th Edition 1 Chapter 2 (Part 2) MATLAB Basics dr.dcd.h CS 101 /SJC 5th Edition 1 Display Format In the command window, integers are always displayed as integers Characters are always displayed as strings Other values

More information

To start using Matlab, you only need be concerned with the command window for now.

To start using Matlab, you only need be concerned with the command window for now. Getting Started Current folder window Atop the current folder window, you can see the address field which tells you where you are currently located. In programming, think of it as your current directory,

More information

EP375 Computational Physics

EP375 Computational Physics EP375 Computational Physics Topic 1 MATLAB TUTORIAL BASICS Department of Engineering Physics University of Gaziantep Feb 2014 Sayfa 1 Basic Commands help command get help for a command clear all clears

More information

What is a Function? EF102 - Spring, A&S Lecture 4 Matlab Functions

What is a Function? EF102 - Spring, A&S Lecture 4 Matlab Functions What is a Function? EF102 - Spring, 2002 A&S Lecture 4 Matlab Functions What is a M-file? Matlab Building Blocks Matlab commands Built-in commands (if, for, ) Built-in functions sin, cos, max, min Matlab

More information

Introduction to MATLAB for Numerical Analysis and Mathematical Modeling. Selis Önel, PhD

Introduction to MATLAB for Numerical Analysis and Mathematical Modeling. Selis Önel, PhD Introduction to MATLAB for Numerical Analysis and Mathematical Modeling Selis Önel, PhD Advantages over other programs Contains large number of functions that access numerical libraries (LINPACK, EISPACK)

More information

Chapter 3. built in functions help feature elementary math functions data analysis functions random number functions computational limits

Chapter 3. built in functions help feature elementary math functions data analysis functions random number functions computational limits Chapter 3 built in functions help feature elementary math functions data analysis functions random number functions computational limits I have used resources for instructors, available from the publisher

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB The Desktop When you start MATLAB, the desktop appears, containing tools (graphical user interfaces) for managing files, variables, and applications associated with MATLAB. The following

More information

Dr Richard Greenaway

Dr Richard Greenaway SCHOOL OF PHYSICS, ASTRONOMY & MATHEMATICS 4PAM1008 MATLAB 2 Basic MATLAB Operation Dr Richard Greenaway 2 Basic MATLAB Operation 2.1 Overview 2.1.1 The Command Line In this Workshop you will learn how

More information

ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah)

ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah) Introduction ELEC4042 Signal Processing 2 MATLAB Review (prepared by A/Prof Ambikairajah) MATLAB is a powerful mathematical language that is used in most engineering companies today. Its strength lies

More information

Introduction to MATLAB. Computational Probability and Statistics CIS 2033 Section 003

Introduction to MATLAB. Computational Probability and Statistics CIS 2033 Section 003 Introduction to MATLAB Computational Probability and Statistics CIS 2033 Section 003 About MATLAB MATLAB (MATrix LABoratory) is a high level language made for: Numerical Computation (Technical computing)

More information

Introduction to Computer Programming in Python Dr. William C. Bulko. Data Types

Introduction to Computer Programming in Python Dr. William C. Bulko. Data Types Introduction to Computer Programming in Python Dr William C Bulko Data Types 2017 What is a data type? A data type is the kind of value represented by a constant or stored by a variable So far, you have

More information

Introduction to MATLAB for Engineers, Third Edition

Introduction to MATLAB for Engineers, Third Edition PowerPoint to accompany Introduction to MATLAB for Engineers, Third Edition William J. Palm III Chapter 2 Numeric, Cell, and Structure Arrays Copyright 2010. The McGraw-Hill Companies, Inc. This work is

More information

MATLAB Tutorial EE351M DSP. Created: Thursday Jan 25, 2007 Rayyan Jaber. Modified by: Kitaek Bae. Outline

MATLAB Tutorial EE351M DSP. Created: Thursday Jan 25, 2007 Rayyan Jaber. Modified by: Kitaek Bae. Outline MATLAB Tutorial EE351M DSP Created: Thursday Jan 25, 2007 Rayyan Jaber Modified by: Kitaek Bae Outline Part I: Introduction and Overview Part II: Matrix manipulations and common functions Part III: Plots

More information

Constraint-based Metabolic Reconstructions & Analysis H. Scott Hinton. Matlab Tutorial. Lesson: Matlab Tutorial

Constraint-based Metabolic Reconstructions & Analysis H. Scott Hinton. Matlab Tutorial. Lesson: Matlab Tutorial 1 Matlab Tutorial 2 Lecture Learning Objectives Each student should be able to: Describe the Matlab desktop Explain the basic use of Matlab variables Explain the basic use of Matlab scripts Explain the

More information

AMS 27L LAB #1 Winter 2009

AMS 27L LAB #1 Winter 2009 AMS 27L LAB #1 Winter 2009 Introduction to MATLAB Objectives: 1. To introduce the use of the MATLAB software package 2. To learn elementary mathematics in MATLAB Getting Started: Log onto your machine

More information

Programming in Mathematics. Mili I. Shah

Programming in Mathematics. Mili I. Shah Programming in Mathematics Mili I. Shah Starting Matlab Go to http://www.loyola.edu/moresoftware/ and login with your Loyola name and password... Matlab has eight main windows: Command Window Figure Window

More information

McTutorial: A MATLAB Tutorial

McTutorial: A MATLAB Tutorial McGill University School of Computer Science Sable Research Group McTutorial: A MATLAB Tutorial Lei Lopez Last updated: August 2014 w w w. s a b l e. m c g i l l. c a Contents 1 MATLAB BASICS 3 1.1 MATLAB

More information

Math 2250 MATLAB TUTORIAL Fall 2005

Math 2250 MATLAB TUTORIAL Fall 2005 Math 2250 MATLAB TUTORIAL Fall 2005 Math Computer Lab The Mathematics Computer Lab is located in the T. Benny Rushing Mathematics Center (located underneath the plaza connecting JWB and LCB) room 155C.

More information

Introduction to PartSim and Matlab

Introduction to PartSim and Matlab NDSU Introduction to PartSim and Matlab pg 1 PartSim: www.partsim.com Introduction to PartSim and Matlab PartSim is a free on-line circuit simulator that we use in Circuits and Electronics. It works fairly

More information

Process Optimization

Process Optimization Process Optimization Tier II: Case Studies Section 1: Lingo Optimization Software Optimization Software Many of the optimization methods previously outlined can be tedious and require a lot of work to

More information

Math 340 Fall 2014, Victor Matveev. Binary system, round-off errors, loss of significance, and double precision accuracy.

Math 340 Fall 2014, Victor Matveev. Binary system, round-off errors, loss of significance, and double precision accuracy. Math 340 Fall 2014, Victor Matveev Binary system, round-off errors, loss of significance, and double precision accuracy. 1. Bits and the binary number system A bit is one digit in a binary representation

More information

Digital Image Analysis and Processing CPE

Digital Image Analysis and Processing CPE Digital Image Analysis and Processing CPE 0907544 Matlab Tutorial Dr. Iyad Jafar Outline Matlab Environment Matlab as Calculator Common Mathematical Functions Defining Vectors and Arrays Addressing Vectors

More information

A Short Introduction to Matlab

A Short Introduction to Matlab A Short Introduction to Matlab Sheng Xu & Daniel Reynolds SMU Mathematics, 2015 1 What is Matlab? Matlab is a computer language with many ready-to-use powerful and reliable algorithms for doing numerical

More information

6-1 (Function). (Function) !*+!"#!, Function Description Example. natural logarithm of x (base e) rounds x to smallest integer not less than x

6-1 (Function). (Function) !*+!#!, Function Description Example. natural logarithm of x (base e) rounds x to smallest integer not less than x (Function) -1.1 Math Library Function!"#! $%&!'(#) preprocessor directive #include !*+!"#!, Function Description Example sqrt(x) square root of x sqrt(900.0) is 30.0 sqrt(9.0) is 3.0 exp(x) log(x)

More information

Introduction to Octave/Matlab. Deployment of Telecommunication Infrastructures

Introduction to Octave/Matlab. Deployment of Telecommunication Infrastructures Introduction to Octave/Matlab Deployment of Telecommunication Infrastructures 1 What is Octave? Software for numerical computations and graphics Particularly designed for matrix computations Solving equations,

More information

EGR 111 Introduction to MATLAB

EGR 111 Introduction to MATLAB EGR 111 Introduction to MATLAB This lab introduces the MATLAB help facility, shows how MATLAB TM, which stands for MATrix LABoratory, can be used as an advanced calculator. This lab also introduces assignment

More information

LAB 1 General MATLAB Information 1

LAB 1 General MATLAB Information 1 LAB 1 General MATLAB Information 1 General: To enter a matrix: > type the entries between square brackets, [...] > enter it by rows with elements separated by a space or comma > rows are terminated by

More information

Introduction to Computer Programming with MATLAB Matlab Fundamentals. Selis Önel, PhD

Introduction to Computer Programming with MATLAB Matlab Fundamentals. Selis Önel, PhD Introduction to Computer Programming with MATLAB Matlab Fundamentals Selis Önel, PhD Today you will learn to create and execute simple programs in MATLAB the difference between constants, variables and

More information

This is a basic tutorial for the MATLAB program which is a high-performance language for technical computing for platforms:

This is a basic tutorial for the MATLAB program which is a high-performance language for technical computing for platforms: Appendix A Basic MATLAB Tutorial Extracted from: http://www1.gantep.edu.tr/ bingul/ep375 http://www.mathworks.com/products/matlab A.1 Introduction This is a basic tutorial for the MATLAB program which

More information

One-dimensional Array

One-dimensional Array One-dimensional Array ELEC 206 Prof. Siripong Potisuk 1 Defining 1-D Array Also known as a vector A list of numbers arranged in a row row vector or a column column vector A scalar variable is a one-element

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Dr./ Ahmed Nagib Mechanical Engineering department, Alexandria university, Egypt Sep 2015 Chapter 5 Functions Getting Help for Functions You can use the lookfor command to find functions

More information

Introduction to MATLAB 7 for Engineers

Introduction to MATLAB 7 for Engineers PowerPoint to accompany Introduction to MATLAB 7 for Engineers William J. Palm III Chapter 2 Numeric, Cell, and Structure Arrays Copyright 2005. The McGraw-Hill Companies, Inc. Permission required for

More information

Introduction to MATLAB

Introduction to MATLAB Introduction to MATLAB Dr./ Ahmed Nagib Mechanical Engineering department, Alexandria university, Egypt Spring 2017 Chapter 4 Decision making and looping functions (If, for and while functions) 4-1 Flowcharts

More information

What is MATLAB? What is MATLAB? Programming Environment MATLAB PROGRAMMING. Stands for MATrix LABoratory. A programming environment

What is MATLAB? What is MATLAB? Programming Environment MATLAB PROGRAMMING. Stands for MATrix LABoratory. A programming environment What is MATLAB? MATLAB PROGRAMMING Stands for MATrix LABoratory A software built around vectors and matrices A great tool for numerical computation of mathematical problems, such as Calculus Has powerful

More information

A/D Converter. Sampling. Figure 1.1: Block Diagram of a DSP System

A/D Converter. Sampling. Figure 1.1: Block Diagram of a DSP System CHAPTER 1 INTRODUCTION Digital signal processing (DSP) technology has expanded at a rapid rate to include such diverse applications as CDs, DVDs, MP3 players, ipods, digital cameras, digital light processing

More information

Finding, Starting and Using Matlab

Finding, Starting and Using Matlab Variables and Arrays Finding, Starting and Using Matlab CSC March 6 &, 9 Array: A collection of data values organized into rows and columns, and known by a single name. arr(,) Row Row Row Row 4 Col Col

More information

Experiment 1: Introduction to MATLAB I. Introduction. 1.1 Objectives and Expectations: 1.2 What is MATLAB?

Experiment 1: Introduction to MATLAB I. Introduction. 1.1 Objectives and Expectations: 1.2 What is MATLAB? Experiment 1: Introduction to MATLAB I Introduction MATLAB, which stands for Matrix Laboratory, is a very powerful program for performing numerical and symbolic calculations, and is widely used in science

More information

TI- Nspire Testing Instructions

TI- Nspire Testing Instructions TI- Nspire Testing Instructions Table of Contents How to Nsolve How to Check Compositions of Functions How to Verify Compositions of Functions How to Check Factoring How to Use Graphs to Backward Factor

More information

Ordinary Differential Equation Solver Language (ODESL) Reference Manual

Ordinary Differential Equation Solver Language (ODESL) Reference Manual Ordinary Differential Equation Solver Language (ODESL) Reference Manual Rui Chen 11/03/2010 1. Introduction ODESL is a computer language specifically designed to solve ordinary differential equations (ODE

More information

Variables are used to store data (numbers, letters, etc) in MATLAB. There are a few rules that must be followed when creating variables in MATLAB:

Variables are used to store data (numbers, letters, etc) in MATLAB. There are a few rules that must be followed when creating variables in MATLAB: Contents VARIABLES... 1 Storing Numerical Data... 2 Limits on Numerical Data... 6 Storing Character Strings... 8 Logical Variables... 9 MATLAB S BUILT-IN VARIABLES AND FUNCTIONS... 9 GETTING HELP IN MATLAB...

More information

2.Simplification & Approximation

2.Simplification & Approximation 2.Simplification & Approximation As we all know that simplification is most widely asked topic in almost every banking exam. So let us try to understand what is actually meant by word Simplification. Simplification

More information

ENGR Fall Exam 1

ENGR Fall Exam 1 ENGR 1300 Fall 01 Exam 1 INSTRUCTIONS: Duration: 60 minutes Keep your eyes on your own work! Keep your work covered at all times! 1. Each student is responsible for following directions. Read carefully..

More information

1. Register an account on: using your Oxford address

1. Register an account on:   using your Oxford  address 1P10a MATLAB 1.1 Introduction MATLAB stands for Matrix Laboratories. It is a tool that provides a graphical interface for numerical and symbolic computation along with a number of data analysis, simulation

More information

ENGR 1181 MATLAB 4: Array Operations

ENGR 1181 MATLAB 4: Array Operations ENGR 81 MTL 4: rray Operations Learning Objectives 1. Explain meaning of element-by-element operations. Identify situations where the standard operators in MTL (when used with arrays) are reserved for

More information

Introduction to MATLAB Practical 1

Introduction to MATLAB Practical 1 Introduction to MATLAB Practical 1 Daniel Carrera November 2016 1 Introduction I believe that the best way to learn Matlab is hands on, and I tried to design this practical that way. I assume no prior

More information

Basic MATLAB Tutorial

Basic MATLAB Tutorial Basic MATLAB Tutorial http://www1gantepedutr/~bingul/ep375 http://wwwmathworkscom/products/matlab This is a basic tutorial for the Matlab program which is a high-performance language for technical computing

More information

Watkins Mill High School. Algebra 2. Math Challenge

Watkins Mill High School. Algebra 2. Math Challenge Watkins Mill High School Algebra 2 Math Challenge "This packet will help you prepare for Algebra 2 next fall. It will be collected the first week of school. It will count as a grade in the first marking

More information

3+2 3*2 3/2 3^2 3**2 In matlab, use ^ or ** for exponentiation. In fortran, use only ** not ^ VARIABLES LECTURE 1: ARITHMETIC AND FUNCTIONS

3+2 3*2 3/2 3^2 3**2 In matlab, use ^ or ** for exponentiation. In fortran, use only ** not ^ VARIABLES LECTURE 1: ARITHMETIC AND FUNCTIONS LECTURE 1: ARITHMETIC AND FUNCTIONS MATH 190 WEBSITE: www.math.hawaii.edu/ gautier/190.html PREREQUISITE: You must have taken or be taking Calculus I concurrently. If not taken here, specify the college

More information

ELEMENTARY MATLAB PROGRAMMING

ELEMENTARY MATLAB PROGRAMMING 1 ELEMENTARY MATLAB PROGRAMMING (Version R2013a used here so some differences may be encountered) COPYRIGHT Irving K. Robbins 1992, 1998, 2014, 2015 All rights reserved INTRODUCTION % It is assumed the

More information

Part #1. A0B17MTB Matlab. Miloslav Čapek Filip Kozák, Viktor Adler, Pavel Valtr

Part #1. A0B17MTB Matlab. Miloslav Čapek Filip Kozák, Viktor Adler, Pavel Valtr A0B17MTB Matlab Part #1 Miloslav Čapek miloslav.capek@fel.cvut.cz Filip Kozák, Viktor Adler, Pavel Valtr Department of Electromagnetic Field B2-626, Prague You will learn Scalars, vectors, matrices (class

More information

Class #15: Experiment Introduction to Matlab

Class #15: Experiment Introduction to Matlab Class #15: Experiment Introduction to Matlab Purpose: The objective of this experiment is to begin to use Matlab in our analysis of signals, circuits, etc. Background: Before doing this experiment, students

More information

ME 142 Engineering Computation I. Unit 1.2 Excel Functions

ME 142 Engineering Computation I. Unit 1.2 Excel Functions ME 142 Engineering Computation I Unit 1.2 Excel Functions TOA Make sure to submit TOA If not submitted, will receive score of 0 Common Questions from 1.1 & 1.2 Named Cell PP 1.1.2 Name cell B2 Payrate

More information

Binary floating point encodings

Binary floating point encodings Week 1: Wednesday, Jan 25 Binary floating point encodings Binary floating point arithmetic is essentially scientific notation. Where in decimal scientific notation we write in floating point, we write

More information

What is Matlab? The command line Variables Operators Functions

What is Matlab? The command line Variables Operators Functions What is Matlab? The command line Variables Operators Functions Vectors Matrices Control Structures Programming in Matlab Graphics and Plotting A numerical computing environment Simple and effective programming

More information

MATLAB Basics. Configure a MATLAB Package 6/7/2017. Stanley Liang, PhD York University. Get a MATLAB Student License on Matworks

MATLAB Basics. Configure a MATLAB Package 6/7/2017. Stanley Liang, PhD York University. Get a MATLAB Student License on Matworks MATLAB Basics Stanley Liang, PhD York University Configure a MATLAB Package Get a MATLAB Student License on Matworks Visit MathWorks at https://www.mathworks.com/ It is recommended signing up with a student

More information

TECH TIP VISION Calibration and Data Acquisition Software

TECH TIP VISION Calibration and Data Acquisition Software TECH TIP VISION Calibration and Data Acquisition Software May 2016 Using Calculated Channels in VISION Calculated channels are data items created in a Recorder file whose values are calculated from other

More information

Chapter 2. Outline. Simple C++ Programs

Chapter 2. Outline. Simple C++ Programs Chapter 2 Simple C++ Programs Outline Objectives 1. Building C++ Solutions with IDEs: Dev-cpp, Xcode 2. C++ Program Structure 3. Constant and Variables 4. C++ Operators 5. Standard Input and Output 6.

More information

ME 121 MATLAB Lesson 01 Introduction to MATLAB

ME 121 MATLAB Lesson 01 Introduction to MATLAB 1 ME 121 MATLAB Lesson 01 Introduction to MATLAB Learning Objectives Be able run MATLAB in the MCECS computer labs Be able to perform simple interactive calculations Be able to open and view an m-file

More information

Introduction to MATLAB

Introduction to MATLAB Chapter 1 Introduction to MATLAB 1.1 Software Philosophy Matrix-based numeric computation MATrix LABoratory built-in support for standard matrix and vector operations High-level programming language Programming

More information

Programming in MATLAB

Programming in MATLAB trevor.spiteri@um.edu.mt http://staff.um.edu.mt/trevor.spiteri Department of Communications and Computer Engineering Faculty of Information and Communication Technology University of Malta 17 February,

More information

Engineering Problem Solving with C++, Etter/Ingber

Engineering Problem Solving with C++, Etter/Ingber Engineering Problem Solving with C++, Etter/Ingber Chapter 2 Simple C++ Programs C++, Second Edition, J. Ingber 1 Simple C++ Programs Program Structure Constants and Variables C++ Operators Standard Input

More information

Maths Functions User Manual

Maths Functions User Manual Professional Electronics for Automotive and Motorsport 6 Repton Close Basildon Essex SS13 1LE United Kingdom +44 (0) 1268 904124 info@liferacing.com www.liferacing.com Maths Functions User Manual Document

More information

MATLAB. A Tutorial By. Masood Ejaz

MATLAB. A Tutorial By. Masood Ejaz MATLAB A Tutorial By Masood Ejaz Note: This tutorial is a work in progress and written specially for CET 3464 Software Programming in Engineering Technology, a course offered as part of BSECET program

More information

Arithmetic. 2.2.l Basic Arithmetic Operations. 2.2 Arithmetic 37

Arithmetic. 2.2.l Basic Arithmetic Operations. 2.2 Arithmetic 37 2.2 Arithmetic 37 This is particularly important when programs are written by more than one person. It may be obvious to you that cv stands for can volume and not current velocity, but will it be obvious

More information

MatLab Just a beginning

MatLab Just a beginning MatLab Just a beginning P.Kanungo Dept. of E & TC, C.V. Raman College of Engineering, Bhubaneswar Introduction MATLAB is a high-performance language for technical computing. MATLAB is an acronym for MATrix

More information

Lecture 1 arithmetic and functions

Lecture 1 arithmetic and functions Lecture 1 arithmetic and functions MATH 190 WEBSITE: www.math.hawaii.edu/190 Open MATH 190 in a web browser. Read and accept the Terms of Acceptable Lab Use. Open Lecture 1. PREREQUISITE: You must have

More information

WHOLE NUMBER AND DECIMAL OPERATIONS

WHOLE NUMBER AND DECIMAL OPERATIONS WHOLE NUMBER AND DECIMAL OPERATIONS Whole Number Place Value : 5,854,902 = Ten thousands thousands millions Hundred thousands Ten thousands Adding & Subtracting Decimals : Line up the decimals vertically.

More information

Matlab Tutorial: Basics

Matlab Tutorial: Basics Matlab Tutorial: Basics Topics: opening matlab m-files general syntax plotting function files loops GETTING HELP Matlab is a program which allows you to manipulate, analyze and visualize data. MATLAB allows

More information

Scientific Computing with MATLAB

Scientific Computing with MATLAB Scientific Computing with MATLAB Dra. K.-Y. Daisy Fan Department of Computer Science Cornell University Ithaca, NY, USA UNAM IIM 2012 2 Focus on computing using MATLAB Computer Science Computational Science

More information

1 Introduction to Matlab

1 Introduction to Matlab 1 Introduction to Matlab 1. What is Matlab? Matlab is a computer program designed to do mathematics. You might think of it as a super-calculator. That is, once Matlab has been started, you can enter computations,

More information

CT 229 Java Syntax Continued

CT 229 Java Syntax Continued CT 229 Java Syntax Continued 06/10/2006 CT229 Lab Assignments Due Date for current lab assignment : Oct 8 th Before submission make sure that the name of each.java file matches the name given in the assignment

More information

Methods CSC 121 Fall 2014 Howard Rosenthal

Methods CSC 121 Fall 2014 Howard Rosenthal Methods CSC 121 Fall 2014 Howard Rosenthal Lesson Goals Understand what a method is in Java Understand Java s Math Class Learn the syntax of method construction Learn both void methods and methods that

More information

Basic stuff -- assignments, arithmetic and functions

Basic stuff -- assignments, arithmetic and functions Basic stuff -- assignments, arithmetic and functions Most of the time, you will be using Maple as a kind of super-calculator. It is possible to write programs in Maple -- we will do this very occasionally,

More information

EL2310 Scientific Programming

EL2310 Scientific Programming Lecture 4: Programming in Matlab Yasemin Bekiroglu (yaseminb@kth.se) Florian Pokorny(fpokorny@kth.se) Overview Overview Lecture 4: Programming in Matlab Wrap Up More on Scripts and Functions Wrap Up Last

More information