Spelling Error

MATLAB

This set of MATLAB Multiple Choice Questions & Answers (MCQs) focuses on “Spelling Error – 1”.

1. What is the output of the following code?

T=-9:0:9;
STEM(T);

a) Error
b) Plots a ramp function from 0 to 9 units in time
c) Plots a discrete function
d) Logical Error

2. What is the output of the following code?

N=Input[‘’];

a) Ask for an input from the user
b) Asks for an input from the user which has to be kind of number
c) Input command does not exist
d) Syntactical Error

3. Given below is a part of a very big program. What is the output?

A=[1 2 3];
mean(a);

a) Error
b) 2
c) Cannot be determined
d) The mean of a

4. A student is trying to plot multiple plots in the same window. But the following code doesn’t allow him to do that. What is the error?

t=0:1:9;
stem(t);
hld;
stem(t^2);

a) Error in t^2
b) Error in hld
c) No error
d) Error in stem(t)

5. What is the output of the following code?

Recpulse(1,9)

a) A column vector of 1’s of length 9
b) A column vector of 1’s of length 10
c) A row vector of 1’s of length 9
d) Error

6. What is the output of the following code?

tripulse(3)

a) Error
b) 0
c) 1
d) 2

7. What is the output of the following code?

Mean([1 2 3 4])

a) Error due to the Mean command
b) 2.5
c) 2 and 3
d) Syntactical Error

8. What is the output of the following code?

lengths([1 2 3])

a) 3
b) 1*3
c) Error due to lengths command
d) Cannot be determined

9. What is the output of the following code?

sten([0:1:4],2*ones(1,5)]

a) A discrete step function
b) A discrete pulse function from 0 to 4 units in time
c) A ramp function
d) Error

10. There are a few commands, in MATLAB, which can be used by ignoring the cases.
a) True
b) False

11. What is the output of the following code?

plot([0:1:4],one(1,5))

a) A pulse function from 0 to 4 units in time
b) A step function
c) A ramp function
d) Error

12. What is the error when MATLAB finds an unknown command or function?
a) Undefined function
b) Undefined function or variable ‘command name’
c) Undefined variable or function
d) Undefined function or variable ‘command name’

13. What is the output of the following code?

stem([0:1:1],zero(1,2))

a) An empty graph extending from 0 to 1 unit in x axis and 0 to 2 in the y axis
b) An empty graph extending from 0 to 1 unit in y axis and 0 to 2 in the x axis
c) Syntactical Error
d) Error in zero command

14. What is the output of the following code?

sine(pi/2)

a) Error due to pi
b) Error due to sine
c) 1
d) Cannot be determined

15. A user defined function can be used by neglecting case sensitivity.
a) True
b) False

16. What is the output of the following code?

decon([6 12 18],[ 1 2 3])

a) 6
b) 0
c) Cannot be determined
d) Error

17. What is the output of the following code?

syms t;
ipulse([1],[1 0])

a) A step function
b) A ramp function
c) Logical error
d) Spelling error

18. What is the output of the following code?

syms t; 
stip([1],[1 0 0])

a) A step function
b) A ramp function
c) Logical error
d) Spelling error

19. What is the output of the following code?

laplacet(t^2);

a) Error in the input
b) Error in the command
c) 2/s^3
d) Cannot be determined

Leave a Reply

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