adplus-dvertising
frame-decoration

Question

What will be the output of the following code?
for i=1 : 3
i=i-1
end

a.

i will be printed thrice as 0,1,2 successively

b.

Infinite loop

c.

No output

d.

i=2

Posted under MATLAB

Answer: (a).i will be printed thrice as 0,1,2 successively

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the following code?

Similar Questions

Discover Related MCQs

Q. How can we close all graphs in MATLAB?

Q. clc in a function will clear the function.

Q. ___________ will give a hint that the file is closed.

Q. To delete one variable but not the entire workspace, we need to mention the variable name after the clear command.

Q. What is the nature of storage of anything in MATLAB?

Q. What is the starting index of an array in MATLAB?

Q. All data types are converted to ____ before mathematical operations.

Q. What is the return type of angles in MATLAB?

Q. To represent only two digits after the decimal point, the format we use is ______

Q. How do we change the nature of the display of the numerical answer?

Q. Strings are stored in ____ variables.

Q. What are the minimum numbers of expressions which will be required to express a mathematical relation?

Q. The teacher has given the assignment to find the sum of 2 numbers. But the code should not contain the ‘+’ operator. What is to be done?

Q. A mathematical statement is a combination of functions and variables only.

Q. What is the command which can be used to see the expressions within a user-defined function in MATLAB?

Q. What are mathematical expressions?

Q. Which command is used to find the argument of a complex number?

Q. What is the class of the complex number?

Q. What is the argument of -1-i in MATLAB?

Q. The modulus of z, z conjugate and -z are not equal in MATLAB.