Recitation 02 Problems

Recitation 02 Problems - 14:440:127 Introduction to...

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

View Full Document Right Arrow Icon
14:440:127 Introduction to Computers for Engineers Recitation 2- Problems for students to attempt Please complete these problems on your own time if you do not finish in recitation. You don’t need to show us the completed recitation problems, although we recommending saving a copy of your solutions for your own benefit. 1) Write Matlab code that displays “You must go to study right away” if the variable TVTime equals 1. 2) Create a row vector containing the even numbers 2 through 18, a column vector containing 1,5,9,…,25,29, and a 3*3 matrix A full of zeros . 3) Create a 3 x 4 matrix in which all the elements have a value of pi. Then, change all elements in the 2nd row to -pi. Finally, display the sine of each value in the matrix. 4) Evaluate the following Matlab Expressions by hand. Verify in Matlab: a. 2 + round(6/9 + 3*2)/2 - 3 b. 3^2+ceil(6/9+3*)/2 - 3 c. 3^2+floor(6/9+3*)/2 -3 d. 3^2+fix(6/9+3*)/2 -3 5) Ask the user to input a number, and then display whether that number is odd or even. 6) Create a variable x and assign it some value. Write an if statement that displays the square root of x if x is 0 or greater, and displays “X is negative” otherwise. 7) Assign the variable x to be some number. Write an if statement that displays whether or not x is an integer. (hint for one approach: try comparing x with the result of rounding x .) 8) Use Matlab to compute the following, given that x = 2.7, 15: e^x + x^(1/2)sin(x)cos(x) 9) Create a vector that starts from 11, ends at 43 and contains 100 points. Then create a vector that starts from 11,
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.

This note was uploaded on 01/11/2010 for the course 440 127 taught by Professor Blase during the Fall '09 term at Rutgers.

Page1 / 2

Recitation 02 Problems - 14:440:127 Introduction to...

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