Sums and Products – 2 MCQ’s

Read Time:1 Minute, 52 Second

This set of MATLAB Multiple Choice Questions & Answers (MCQs) focuses on “Sums and Products – 2″.

1. What is the output of the following code?

meanabs(1,2,-1)

a) 1.33
b) 1
c) 0
d) .666

2. What is the output of the following code?

A=[1:3:7;2:3:8;3:3:9]; prod(A,1)

a) Error
b) 6 20 504
c)

    6
    20
    504

d) 28 80 162

3. What is the output of the following code?

meansqr(NaN)

a) 0
b) NaN
c) Error
d) 1

4. What is the output of the following code?

prod(1:NaN)

a) 0
b) 1
c) NaN
d) Error

5. What is the output of the following code?

cumsum[NaN]

a) NaN
b) 0
c) Error due to NaN
d) Syntactical Error

6. The product of a set of elements is always greater than it’s the cumulative sum.
a) True
b) False

7. What is the output of the following code?

cumsum([1,2,3,4,NaN])

a) 1 3 6 10 NaN
b) NaN
c)

    1
    3
    6
   10
  NaN

d) Error

8. What is the output of the following code?

A=[1:3:7;2:3:8;3:3:9]; prod(A,2)’

a) 28 80 162
b)

    20
    80
    162

c) Error
d) NaN

9. The function to find the R.M.S value is __________
a) sqrt(meansqr())
b) sqrt[meansqr[]]
c) sqrt(meansqr[])
d) sqrt[meansqr()]

10. What is the output of the following code?

cumsum(1,2,-1)

a) 1 3 2
b) 2
c) Error due to input
d) Error due to syntax

11. Which function does cumulative summation of elements?
a) sumcum[]
b) sumcum()
c) cumsum[]
d) cumsum()

12. The result of cumsum([1,2,3]) and sum([3,3]) are ____________
a) Same
b) Different
c) Absolute numbers
d) Signed numbers

13. The sum function will return a NaN if any of the element in the input vector is NaN.
a) True
b) False

14. What is the output of the following code shown?

syms a k; symsum(a^k, 0, Inf)

a) 1/1-a
b) Inf
c) Error due to Inf
d) Error due to an unmentioned value of a

15. What is the output of the following code?

syms a,k; symsum(a^k, 1, Inf)

a) Error
b) -1/(a-1) -1
c) -1/(a-1)
d) Inf

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

Your email address will not be published. Required fields are marked *

Previous post Sums and Products – 1 MCQ’s
Next post Default Variables MCQ’s