Unformatted text preview: 2^100, you instead must use a bunch of multiplications). “No Computer” Question 2: What’s the largest integer that the int8 data type can store correctly? “No Computer” Question 3: Write a function called changedyourvectorHAHA that accepts as input a vector. As your output, you should return that same vector, but randomly change one of the elements of the vector to 1337. (Hint: generate a random integer between 1 and the length( ), and set that location in the vector equal to 1337). “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, write code to 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
- Fall '09
- matlab, blue book, Matlab programming language, normal engineering account