Arithmetic – 2 MCQ’s

Read Time:2 Minute, 21 Second

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

1. Round each value in a duration array to the nearest number of seconds greater than or equal to that value.

t = hours(8) + minutes(29:31) + seconds(1.23);
t.Format = 'hh:mm:ss.SS'
t = 08:29:01.23   08:30:01.23   08:31:01.23
Y1 = ceil(t)
Y2 = ceil(t,'hours')

a)

     Y1 =  08:29:02.00   08:30:02.00   08:31:02.00 
     Y2 =  09:00:00.00   09:00:00.00   09:00:00.00

b)

     Y1 =  08:29:02.00   08:30:02.00   08:31:02.00 
     Y2 =  08:29:01.23   08:30:01.23   08:31:01.23

c)

     Y1 =  08:29:01.23   08:30:01.23   08:31:01.23
     Y2 =  08:29:01.23   08:30:01.23   08:31:01.23

d)

     Y1 =  008:29:01.23   08:30:01.23   08:31:01.23
     Y2 =  09:00:00.00   09:00:00.00   09:00:00.00

2. If one operand is a scalar and the other is not, then MATLAB applies the scalar to every element of the other operand. This property is known as ______________
a) operand divergence
b) scalar expansion
c) vector expansion
d) dimension declaration

3. What would be the output of the following code (in editor window)?

X = [1.4+2.3i 3.1-2.2i -5.3+10.9i]
X = 1.4000 + 2.3000i   3.1000 - 2.2000i  -5.3000 +10.9000i
Y = fix(X)

a) Y = 1.0000 + 2.0000i 3.0000 – 4.0000i -5.0000 +10.0000i
b) Y = 2.0000 + 3.0000i 3.1000 – 2.2000i -5.3000 +10.9000i
c) Y = 1.0000 + 2.0000i 3.0000 – 2.0000i -5.0000 +10.0000i
d) Y = 2.0000 + 3.0000i 3.1000 – 2.2000i -5.3000 +10.9000i

4. Conversion Function int16 uses_________ range of value?
a) -27 to 27-1
b) -215 to 215-1
c) -231 to 231-1
d) 0 to 216-1

5. Compute 24 modulo 5.

b = mod(24,5)

a) b = 3
b) b =4
c) b =5
d) b =6

6. What would be the output of the following code (in editor window)?

X = [1 2 3;4 5 6;7 8 9];
Y = [9 8 7;6 5 4;3 2 1];
R = rem(X,Y)

a)

   R = 1     2     1
       4     0     9
       1     0     0

b)

   R = 1     2     3
       3     0     2
       1     0     0

c)

   R = 1     2     3
       4     1     2
       1     1     0

d)

   R = 1     2     3
       4     0     2
       1     0     0

7. Largest and smallest values for integer classes is 127 to -128.
a) True
b) False

8. Matrix operations follow the rules of linear algebra and are not compatible with multidimensional arrays.
a) true
b) false

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 Arithmetic – 1 MCQ’s
Next post Algebra MCQ’s