MATLAB comp progHW3

MATLAB comp progHW3 - Fall 2010, Dr. Frank Shih CS 101...

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

View Full Document Right Arrow Icon
Fall 2010, Dr. Frank Shih Homework #3 DUE: 11:55pm, October 7, 2010 NOTES: Submit the homework solution in Microsoft Word format to http://moodle.njit.edu/ before the above deadline. Absolutely, no late submission is accepted. Write the answers in your own words individually. Any plagiarism will post a “ZERO” score or cause a “FAIL” grade. 3.1 (30 points) Draw the graph of the sine function over the interval from -4 to 4 with an increment 0.01. Add title “'Plot of y = sin(x)” and “x” and “y” labels to the plot with the title , xlabel , and ylabel functions, respectively. Use grid on to turn on grid lines. Show the Matlab code and the output graph. Answer: >> x=-4:0.1:4; >> y=sin(x); >> plot(x,y); >> xlabel('x'); >> ylabel('y'); >> grid on >> title('Plot Of y=sin(x)') -4 -3 -2 -1 0 1 2 3 4 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 x y Plot Of y=sin(x) 3.2 (35 points) A worker is paid according to his hourly wage up to 40 hours, and 50% more for
Background image of page 1

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

View Full DocumentRight Arrow Icon
Fall 2010, Dr. Frank Shih
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.

Page1 / 3

MATLAB comp progHW3 - Fall 2010, Dr. Frank Shih CS 101...

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