Lab 8 (Thu) - Attempt Review PDF
Lab 8 (Thu) - Attempt Review PDF
Lab 8 (Thu) - Attempt Review PDF
Dashboard / My courses / LE/EECS1560 A - Introduction to Computing for Mathematics and Statistics (Fall 2019-2020) / Lab 8 Material
/ Lab 8 (Thu)
Question 1 Create two random vectors V1 and V2 whose elements sum up to 1. To create a vector whose elements sum up to one, you
Incorrect first create a random vector and then divide it by the sum of its elements. Then create V = conv(V1,V2). The sum of all the
Mark 0.00 out of elements of V is
1.00
Select one:
a. It is always 1
b. It is always zero
d. It is an integer value and depends on the first elements of the arrays V1 and V2
Question 2 To compute the polynomial that results from raising 1+x to the nth power we
Correct
b. use (1+x)^n
The correct answer is: use S=1; for i=1:n S=conv(S,[1, 1]); end
b. Returns the values of a polynomial for one or more values of x (the independent variable).
The correct answer is: Returns the values of a polynomial for one or more values of x (the independent variable).
https://moodle.yorku.ca/moodle/mod/quiz/review.php?attempt=2522411&cmid=2217625 1/3
12/24/2019 Lab 8 (Thu): Attempt review
b. Accepts a vector of roots and returns a polynomial that has these roots.
e. Accepts a set of x and y pairs and returns a polynomial that goes through these x and y pairs.
The correct answer is: Accepts a vector of roots and returns a polynomial that has these roots.
Question 5 Let p1 be a random vector and p2 = poly(roots(p1)). Then the angle between p1 and p2 is
Correct
(Note: the angle of two vectors was discussed in a previous lab)
Mark 1.00 out of
1.00
Select one:
a. 90 degrees
b. 1 radian
d. 1 degree
e. 0 degrees.
Question 6 Let V be a vector of 100 random elements uniformly distributed between 0 and 1. If we convolve V with vector h=
Correct [0.25,0.5,0.25] several times (like V=conv(V,h)) we get
Mark 1.00 out of
1.00 Select one:
a. A vector that has fewer elements with each successive convolution
b. A vector that looks more jagged (rougher) with each successive convolution
c. A random vector that is also uniformly distributed between zero and one (in other words its histogram is more or
less flat)
e. A vector whose histogram looks more like a triangle with each successive convolution
https://moodle.yorku.ca/moodle/mod/quiz/review.php?attempt=2522411&cmid=2217625 2/3
12/24/2019 Lab 8 (Thu): Attempt review
Question 7
The code
Correct
fplot(@(x)polyval(pp,x),[-3,3])
Mark 1.00 out of
plots a function using the built-in function fplot. The first argument to fplot is
1.00
Select one:
a. The handle of an anonymous function
b. A function named pp
c. A vector
res = Fun(3);
end
Select one:
a. 'sin' as in funfun('sin')
b. Can be invoked with any argument since it is meant for geekgeeks to have funfun
c. sin as in funfun(sin)
d. @sin as in funfun(@sin)
Question 9 Write a function named gaussvector that accepts one argument n and returns a vector G of the coefficients of the
Complete polynomial a*(1+x)^n with a chosen so that the the sum of all the elements of G is 1.
Mark 8.00 out of As always your code should be properly indented, have a brief description of what it does and include your name and
8.00
date.
gaussvector.m
Comment:
https://moodle.yorku.ca/moodle/mod/quiz/review.php?attempt=2522411&cmid=2217625 3/3