H- Computer QuestionsExam 1

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

Info iconThis 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 ___"
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 02/29/2012 for the course 440 127 taught by Professor Blase during the Fall '09 term at Rutgers.

Page1 / 2

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

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