HW4 - PETE2060ComputinginPetroleumEngineering Homework4...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
PETE 2060 – Computing in Petroleum Engineering Homework 4 Due date 10 05 2010 1. Create a vector of the even whole numbers between 31 and 75. 2. Let x = [2 5 1 6]. a. Add 16 to each element b. Add 3 to just the odd-index elements c. Compute the square root of each element d. Compute the square of each element 3. Let x = [3 2 6 8]' and y = [4 1 3 5]' (NB. x and y should be column vectors). a. Add the sum of the elements in x to y b. Raise each element of x to the power specified by the corresponding element in y. c. Divide each element of y by the corresponding element in x d. Multiply each element in x by the corresponding element in y, calling the result "z". e. Add up the elements in z and assign the result to a variable called "w". f. Compute x'*y - w and interpret the result 4. Evaluate the following MATLAB expressions by hand and use MATLAB to check the answers a. 2 / 2 * 3 b. 6 - 2 / 5 + 7 ^ 2 - 1 c. 10 / 2 \ 5 - 3 + 2 * 4 d. 3 ^ 2 / 4 e. 3 ^ 2 ^ 2 f. 2 + round(6 / 9 + 3 * 2) / 2 - 3
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

HW4 - PETE2060ComputinginPetroleumEngineering Homework4...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online