Pre3Review - CS 100M Prelim 3 Review Problems Solutions on...

Info icon This preview shows pages 1–3. Sign up to view the full content.

CS 100M: Prelim 3 Review Problems Solutions on Website Monday. 1. AllInterval function B = AllInterval(x,a,b) % x is a length-n vector. % B is assigned the value of 1 (true) if every x-value is in the % interval [a,b]. % B is assigned the value of 0 (false) if at least one of the x-values % is not in the interval [a,b]. % Your implementation should make effective use of a while-loop. 2. Transpose % Refer to lecture 18 and the function TheDigits: C = TheDigits; % C is a length 10 cell array with the property that C{k} is % a 7-by-5 bitmap of the digit k (regarding 0 as the "tenth" digit.) % Produce a length 10 cell array D which houses 5-by-7 bitmaps % of the "transposed" arrays. Thus, since % % C{1} looks like % 00100 % 01100 % 00100 % 00100 % 00100 % 00100 % 01110 % then D{1} should look like % % 0000000 % 0100001 % 1111111 % 0000001 % 0000000 1
Image of page 1

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

3. TotalValue % Refer to the Cost-Inventory application in Lecture 17 % Complete the following function... function T = TotalValue(Inv,Cost) % T is the total value of all the inventory in all the factories 4. VecHasNegAndPos function B = VecHasNegAndPos(x) % x is a length-n vector and n>=2
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.
  • Summer '07
  • FAN/VANLOAN
  • Sociology, Pixel, Web page, 2 %, 17 %, RandomLink

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern