Spring 09 WS 4

# Spring 09 WS 4 - ENG EK 127 Worksheet 4 Name Instructions...

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

ENG EK 127 Worksheet 4 Name: ____________________________________________________ Instructions: Make sure that your Current Directory is set correctly! The minimum set Problems 1-9. 1. The input function can be used to enter a vector, e.g. >> vec = input('Enter a vector: ') Enter a vector: 4:7 vec = 4 5 6 7 Experiment with this, and find out how the user can enter a matrix. 2. Write a script that assigns values for the x coordinate and then y coordinate of a point, and then plots this using a green +. %Create cordinate variables and plot a green '+' x= 10; y = 20; plot(x,y, 'g+' ) 3. In the Command Window, create x and y data points by creating x and y vectors. Now, use the bar function instead of plot to get a bar chart instead. %Create cordinate variables using x and y vectors x= 1:3; y = [6 5 4]; bar(x,y) 4. Plot sin(x) for x values ranging from 0 to π (in separate Figure Windows): using 10 points in this range %This script plots sin(x) ranging from 0 to Pi x = 0: pi/10 : pi; y = sin(x); plot(x,y, 'ro' ) using 100 points in this range %This script plots sin(x) ranging from 0 to Pi x = 0: pi/100 : pi; y = sin(x); plot(x,y, 'ro' )

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

View Full Document
5.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• 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.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern