adplus-dvertising
frame-decoration

Question

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

Posted under MATLAB

Answer: (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

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

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

Similar Questions

Discover Related MCQs

Q. 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 ______________

Q. Matrix operations follow the rules of linear algebra and are not compatible with multidimensional arrays.

Q. Conversion Function int16 uses_________ range of value?

Q. Largest and smallest values for integer classes is 127 to -128.

Q. From the following desktop view of workspace, choose the correct code.

Q. Choose the correct option as an inference from the following workspace view.

Q. What are Max and Min in the Workspace shown below?

Q. What kind of a plot is this?

Q. MATLAB stands for?

Q. Which command is used to clear a command window?

Q. To determine whether an input is MATLAB keyword, command is?

Q. Command used to display the value of variable x.

Q. Command is used to save command window text to file.

Q. To stop the execution of a MATLAB command, used keys?

Q. Which is the invalid variable name in MATLAB?

Q. What is the difference between syms ‘x’ and sym ‘x’?

Q. In the function vpa(‘9⁸¹’,10), why do we put 9⁸¹ within inverted commas?

Q. How would you simplify log(x²⁰) – log(x¹³) – log(x⁷) in MATLAB? (Assume x is defined as a string variable)

Q. What happens if we don’t assign a variable to an expression which evaluates a numerical value?

Q. MATLAB sees a ________ ordered variable as a vector of dimension n*1.