This preview shows pages 1–2. Sign up to view the full content.
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:
Class Grades
Run the following commands, which create a 100 element row vector
b
:
rand( 'state' , 4 ) ;
b = round( 100*rand(1,100)  10 );
class = ‘Matlab’;
Assume that the vector
b
now contains students’ grades for this class.
However,
some of the grades were entered incorrectly.
Write Matlab code
that calculates
the minimum, maximum, and average (mean) grades in the class after
throwing
out (getting rid of) all grades below 0 or above 100.
(i.e. a score of 103 should
not be included in any of your calculations).
Display the following statement
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
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.
 Fall '09
 blase

Click to edit the document details