{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

H- Computer QuestionsExam 1

H- Computer QuestionsExam 1 - Computer Question 1 Subplot W...

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

View Full Document Right Arrow Icon
Computer Question 1: Subplot Write Matlab code that does the following: 1) Begins by setting A = [ 1:10 ; 31:40 ; 26:2:44 ]; 2) Then, your program should calculate the sum of each row of A . If, and only if, the sum of any of the rows of the matrix A is at least 350, your program should display the following two graphs next to each other using subplot, with x containing 243 points running from 1 to 20.: y = x 3 + 2x y = x 4 - 10000 sin(x) Your graph should look like this: Computer Question 2: Product of Composites Run the following commands, which create a 100 element matrix B : rand( 'state' , 4 ) ; B = round( 120*rand(10,10) - 10 ); Write Matlab code that calculates the product of all of the numbers in B after eliminating the following numbers: a) Those that are prime numbers b) Those that are less than 0 or greater than 100 Display the following statement using fprintf, substituting in the values you find: "The product of all composite numbers in B between 0 and 100, inclusive, is ___" You cannot use loops in any part of your answer this question; you must use
Image of page 1

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

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

{[ 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