A- Computer Questions- Solutions and RubricExam 1

A- Computer Questions- Solutions and RubricExam 1 -...

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

View Full Document Right Arrow Icon
Computer Question 1: Plot and Subplot You are given the following points, which are given as (x,y) coordinate pairs, with the y points in scientific notation (4e+010 means 4*10^10): (20, 1.2e+009) (25, 1.8e+011) (30, 2.7e+013) (35, 4.0e+015 (40, 5.9e+017) Write Matlab code that displays the following two graphs next to each other (using the subplot function): a) A standard x-y plot of the points b) A plot of the points where the y axis is logarithmic Title the graphs (“X-Y Plot” and “Y Logarithmic”). Also answer, in one sentence, what you learn about the relationship between x and y as a result of these plots, and suggest a possible equation for y. x = 20:5:40; y = [1.2e+009 1.8e+011 2.7e+013 4.0e+015 5.9e+017]; subplot(1,2,1); plot(x,y); title( 'X-Y Plot' ); subplot(1,2,2); semilogy(x,y); title( 'Y Logarithmic' ); You learn that y is exponentially related to x, so you might have y = e x , potentially with constants added in. -4 if they have minor syntax errors (they had the computer to check answers) -4 if they are missing titles -8 if they at least successfully use 2 of the following: subplot, plot, and colon operator -10 if they at least successfully use 1 of the following: subplot, plot, and colon operator -12 if they seem to kind of understand how to plot things -14 otherwise Computer Question 2: Leap Year Write Matlab code that does the following:
Background image of page 1

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

View Full DocumentRight Arrow Icon
Ask the user to input the year. First, verify that they have entered a number that
Background image of page 2
Image of page 3
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 / 4

A- Computer Questions- Solutions and RubricExam 1 -...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online