fds - Part 1 of 1 - Vectors Question 1 of 10 100.0 Points...

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

View Full Document Right Arrow Icon
Part 1 of 1 - Vectors 100.0 Points Question 1 of 10 10.0 Points When using the range specification/colon operator method, which is in the form of vec = a : increment : b; the numbers a and b are always guaranteed to be in the vector. A. True B. False Question 2 of 10 10.0 Points When using the linspace method, which is in the form of vec = linspace(a, b, number_of_points); the numbers a and b are guaranteed to be in the vector, as long as number_of_points is greater than 2. A. True B. False Question 3 of 10 10.0 Points Given: vec = linspace(0, 25); What is length(vec) equal to? A. 0 B. 50 C. 100 D. 25 E. 26 Question 4 of 10 10.0 Points The line of code: vec = 3:10; is equivilant to which line of code? A. vec = 3:3:10; B. vec = 3:1:10; C. vec = 3:10:10; D. vec = 3:2:10; E. vec = 3:-1:10; Question 5 of 10 10.0 Points Which line of code will create the vector: vec = [5 4 3 2 1] A. vec = 5:1; B. vec = 1:-1:5; C. vec = 1:5; D. vec = 5:-1:1; E. vec = linspace(1, 5); Question 6 of 10 10.0 Points Which of the following generates 10 random numbers from 5 to 7? A. vec = 2*rand(1, 10) + 5; B. vec = rand(1, 10);
Background image of page 1

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

View Full DocumentRight Arrow Icon
C. vec = rand(5, 7, 10); D. vec = rand(5, 7); E. vec = 5*rand(1, 10) + 2; Question 7 of 10 10.0 Points Given the vector: vec = [2 4 6 8 10 12 14]; and the code: vec2 = vec([2 5 7]); What is vec2? A. vec2 = [4 10 14]; B. vec2 = [4 14] C. vec2 = [8 10 12]; D. vec2 = [10 12 14]; E. vec2 = [2 4 6]; Question 8 of 10 10.0 Points What are the three main methods to creating vectors? A. Linspace Method B. Zeros Method C. Random Method D. Direct Entry E. Range Specification/Colon Operator Question 9 of 10 10.0 Points When indexing vectors in MATLAB, the index numbers must be positive integers, aka integers greater than or equal to 1. A. True B. False Question 10 of 10 10.0 Points Given the vector: vec = [1 3 2 8 9]; Which of the following lines of code will not generate an error? A. num = vec(2.1); B. num = vec(0); C. num = vec(4); D. num = vec(-1); E. num = vec(6); Part 1 of 3 - Advanced Vector Indexing 2.0 Points Question 1 of 2 1.0 Points Given a vector vec with values between 1 and 10, how would you define a vector vec2 to contain all of the values of vec between 2 and 6? A. vec2 = vec( vec > 2 | vec < 6 ) B. vec2 = vec( vec > 2 & vec C. vec2 = vec( 2 < vec < 6 );
Background image of page 2
D. vec2 = 2 < vec < 6; Question 2 of 2 1.0 Points Assume coordinate pairs are defined like so: x = [2 4 4 2 2 4 2]; y = [1 3 2 4 3 5 4]; How do I define y2 so that y2 only contains y values where x is equal to 2? (That is, y2 = [1 4 3 4]) A. y2 = y(x==2); B. y2 = x(x==2); C. y2 = y(y==2); D. y2 = x(y==2); Part 2 of 3 - Arrays 4.0 Points Question 1 of 4 1.0 Points What must be true of the dimensions of the arrays A and B for them to be concatenated together vertically? Ex. C = [A; B];
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/21/2011 for the course CS 1371 taught by Professor Stallworth during the Fall '08 term at Georgia Tech.

Page1 / 12

fds - Part 1 of 1 - Vectors Question 1 of 10 100.0 Points...

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

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