adplus-dvertising
frame-decoration

Question

What would be the output of the following code (in editor window)?
A=1:5;
B=cumprod(A)

a.

b=[1 2 6 24 120]

b.

b=[1 2 3 4 5]

c.

b=[5 4 3 2 1]

d.

b=[120 24 6 2 1]

Posted under MATLAB

Answer: (a).b=[1 2 6 24 120]

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

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

Similar Questions

Discover Related MCQs

Q. Create an array of logical values.

A = [true false true; true true false]
A = 1 0 1
1 1 0
B = cumprod(A,2)

Find the cumulative product of the rows of A.

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?