1.

From the following desktop view of workspace, choose the correct code.(a) a=10;b=’pi’;syms c; d=[1,2;0;4];(b) a=10;b=’pi’;syms c; d=[1,2;0,4];(c) a=10;b=pi;syms (c); d=[1,2;0,4];(d) a=10;b=’pi’;syms c; d=[1,2;0,4];I have been asked this question in exam.The doubt is from Managing Variables topic in portion MATLAB Basics of MATLAB

Answer»

Correct option is (a) a=10;b=’pi’;SYMS c; d=[1,2;0;4];

For EXPLANATION I would say: ‘b’ is a character variable, WITHIN inverted commas. ‘a’ is a double variable. ‘c’ is a symbolic object while ‘d’ is a 2*2 MATRIX. The declaration of the VARIABLES is in accordance to the following code:

a=10;b=’pi’;syms c; d=[1,2;0;4];



Discussion

No Comment Found

Related InterviewSolutions