Evaluation – 1 MCQ’s

Electronics & Communication Engineering MATLAB

This set of MATLAB Multiple Choice Questions & Answers (MCQs) focuses on “Evaluation – 1″.

1. What is the output of the following code?

[q,r]=eval(‘sprintf('23 45')’)

a) Unexpected MATLAB expression
b) q=23,r=45
c)

   q = 23
   r = 45

d) Error due to eval

2. What is the output of the following code?

p=eval(cos(0));

a) p=1
b)

    p=
      1

c) Syntactical error
d) The eval command does not exist

3. What is the output of the following code?

[q]=eval(sprintf('23 '))

a) q=23
b) Logical Error
c) Symbolic error
d) No output

4. What is the output of the following code?

evalc(‘cos(0)’)

a) No such command
b) Error
c) 1
d) ‘ ans=1 ’

5. The for keyword can be used to evaluate expressions using eval().
a) True
b) False

6. What is the size of p from the following code?

P=evalc(‘ ’)

a) 2 bytes
b) 0 bytes
c) Error
d) 6 bytes

7. What is common to evalc and the eval commands, apart from the output?
a) The error message is displayed separately
b) The outputs are of different accuracy
c) There is nothing common
d) evalc does not exist

8. What is the output of the following code?

P=eval(‘ ’)

a) P= ‘ ’
b) P will be an empty character array
c) Error
d) No such function

9. The evalc function is different from the eval command ________
a) no difference
b) from precision of output
c) from nature of output
d) from display of output

10. What is the output of the following code?

feval(“sum”,1234,1)

a) Syntactical error
b) Logical Error
c) 1235
d) ‘1234’

Leave a Reply

Your email address will not be published. Required fields are marked *