Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

12/24/2019 Lab 1 (Thu): Attempt review

Dashboard / My courses / LE/EECS1560 A - Introduction to Computing for Mathematics and Statistics (Fall 2019-2020) / Lab 1 Material
/ Lab 1 (Thu)

Started on Thursday, 12 September 2019, 1:01 PM


State Finished
Completed on Thursday, 12 September 2019, 1:53 PM
Time taken 52 mins 33 secs
Marks 8.00/12.00
Grade 66.67 out of 100.00

Question 1 The Matlab statement A=3; does which of the following


Incorrect

Mark 0.00 out of Select one:


1.00
a. Copies 3 into a place in memory named A

b. Defines an equation or logical expression involving coefficient A

c. Creates a vector of size 3

d. Stores number 3 somewhere in the hard disk 

e. Declares that variable A is equal to 3

Your answer is incorrect.

The correct answer is: Copies 3 into a place in memory named A

Question 2 According to the on-line manual (main manual, not the toolkits) command clear
Incorrect

Mark 0.00 out of Select one:


1.00
a. Clears all matlab related files from the disk 

b. Removes items like plot windows, freeing space on your display

c. Clears (removes) variables from memory

d. Gives matlab clairvoyance

e. Clears the command window

Your answer is incorrect.

The correct answer is: Clears (removes) variables from memory

https://moodle.yorku.ca/moodle/mod/quiz/review.php?attempt=2367302&cmid=2169033 1/3
12/24/2019 Lab 1 (Thu): Attempt review

Question 3
When we read the following matlab statement aloud
Correct
A=1
Mark 1.00 out of
1.00 we say

Select one:
a. A is 1

b. A is exactly equal to 1

c. A becomes 1 

d. Oh, not again...

e. A is equal to 1

Your answer is correct.

The correct answer is: A becomes 1

Question 4 A semicolon ";" at the end of a line


Correct

Mark 1.00 out of Select one:


1.00
a. causes matlab to execute the command

b. has no effect

c. separates this statement from the next statement

d. merely indicates that we do not want to see the answer 

e. indicates the end of a matlab statement

Your answer is correct.

The correct answer is: merely indicates that we do not want to see the answer

Question 5 What happens after executing the following triplet of matlab statements
Incorrect
t = A;
Mark 0.00 out of
1.00 A = B;

B = t;

(Hint: assign some values to variables A and B and then execute this triplet (by cutting and pasting) in the command
window or a script. See what values A and B have now.)

Select one:
a. Makes both A and B equal to zero

b. Has no effect 

c. Exchanges the values of A and B.

d. Makes A and B equal

e. Always gives an error

Your answer is incorrect.


The correct answer is: Exchanges the values of A and B.

https://moodle.yorku.ca/moodle/mod/quiz/review.php?attempt=2367302&cmid=2169033 2/3
12/24/2019 Lab 1 (Thu): Attempt review

Question 6 To compute the binomial coefficients we use


Correct

Mark 1.00 out of Select one:


1.00
a. function nchoosek which is the builtin matlab function for this 

b. the function poly to calculate the coefficients

c. paper and pencil, since this cannot be computed by a formula (or use AI and deep learning)

d. function binomcoeff which is the builtin matlab function for this

e. function al_binomcoeff which is does so algebraically.

Your answer is correct.

The correct answer is: function nchoosek which is the builtin matlab function for this

Question 7 Write a short matlab script that computes a binomial coefficient. The script assigns variables n and k two values (these
Complete should be 4 and 2 respectively when submitting but you should try other values to make sure your script is correct). It
Mark 5.00 out of then computes the binomial coefficient using the function factorial. Use no other built in function.The only value printed
6.00 by the script is the binomial coefficient.

Your script should start with a set of comments that include a short description of the script (one or two lines only), your
name, and today's date. Name the script Lab1.m. Write the script in the matlab editor.

Lab1.m

Comment:
Your answer is correct but the output should be only the value of the binomial coefficient. So, the letter"b" should not be
added. 
Your header description is missing your name and date. (-1)

◄ Lab 1 (Tue) Jump to... Lecture Notes and Examples ►

https://moodle.yorku.ca/moodle/mod/quiz/review.php?attempt=2367302&cmid=2169033 3/3

You might also like