This preview shows page 1. Sign up to view the full content.
Unformatted text preview: those results in a vector. Recall that the first two terms of the Fibonacci sequence are both 1. All subsequent terms are the sum of the two preceding terms, i.e. 1, 1, 2, 3, 5, 8, 13,…. At the end, display your vector. “No Computer” Question 2: Write the binary number 1100101 in Base 10. (In other words, convert from Base 2 to Base 10) “No Computer” Question 3: Write a function that returns a vector containing two random integers between -20 and 20. “No Computer” Question 4: a) Write Matlab code that generates a 100 x 100 vector of zeros, and sets just the element in Row 3, Column 4 to be 128. Save this matrix as M1. b) Now, save M1 as a sparse matrix in the variable M2. c) In the preceding example, will the matrix M1 or the matrix M2 use less memory? d) Had the matrix M1 consisted entirely of unique, non-zero values, would M1 or M2 have used less memory?...
View Full Document
This note was uploaded on 02/29/2012 for the course 440 127 taught by Professor Blase during the Fall '09 term at Rutgers.
- Fall '09