# prob1 - % % % % % % % % % % % % % % % % % % % % % % % % % %...

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

% 8/29/2009 4:53 PM % Script Name: prob1 % Script Variables: % 1. vec1 (double) - a vector with elements of "data" and "set" % 2. vec2 (double) - the vector "data" in reverse % 3. vec3 (double) - a vector of numbers from data that are less than 2 % and greater than 8 % 4. vec3length (double) - the length of vec3 % 5. vec4 (double) - a vector of numbers from data that are between 4 and % 8.5. % 6. vec4sum (double) - the sum of the vector "vec4". % 7. vec5 (double) - the scalar product of "data" and "set". % 8. dataAvg - a weighted mean of "data" using "set" as weights. % 9. newData (double) - "data" with every element greater than 5 set to -1 % % Problem Statement: % In the provided "prob1" script, you are given a vector "data" of ten % random numbers between 0 and 10 and a vector "set" defined to be [1 3 2 % 1 2 3 1 2 1 2]. Create the following vectors from "data". You should % not modify "data". % % (a) Create a vector that contains the last 5 elements of "data"

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 10/22/2009 for the course CS 1371 taught by Professor Stallworth during the Fall '08 term at Georgia Tech.

### Page1 / 2

prob1 - % % % % % % % % % % % % % % % % % % % % % % % % % %...

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

View Full Document
Ask a homework question - tutors are online