1.

Command used to display the value of variable x.(a) displayx(b) disp(x)(c) disp x(d) vardisp(‘x’)This question was addressed to me during an online interview.I need to ask this question from Input and Output in chapter MATLAB Basics of MATLAB

Answer»

Right answer is (b) disp(x)

The explanation: disp(X) displays the value of VARIABLE X without printing the variable NAME. ANOTHER way to display a variable is to type its name, but this displays a leading “X =”, which is not always IDEAL. If a variable contains an empty array, disp returns without displaying anything.



Discussion

No Comment Found

Related InterviewSolutions