Suppressing Output MCQ’s

Read Time:1 Minute, 25 Second

This set of MATLAB Multiple Choice Questions & Answers (MCQs) focuses on “Suppressing Output”.

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

close all;
for x = 1.5 : .5 : 2;
y=3; 
x=y+3
 clc
end

a) No value will be stored
b) The result will be printed
c) The result will be printed twice but no value will remain in the Workspace
d) The loop will not run

2. What will be the output of the following code?Join Sanfoundry@YouTubehttps://www.youtube-nocookie.com/embed/7Rb3ZJetvA8?rel=0

for i = 1 :4: 5
y=i+1
clear i
end

a) y=5; i=2
b) y=5, printed twice
c) Loop will run once, y=2
d) Infinite loop

3. Graphs are not suppressed by the ‘;’.
a) True
b) False

4. 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

5. Clear will removes all graphs.
a) True
b) False

6. clc in a function will clear the function.
a) True
b) False

7. How can we close all graphs in MATLAB?
a) Using the close command
b) Using the clear all command
c) Using the close all command
d) Using the clear command

8. ___________ will give a hint that the file is closed.
a) Fopen
b) Fclose
c) Gclose
d) clc

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

for i = 1 : 1
p=i-1
i=i+1;
clc
end

a) i=2
b) p will be printed
c) Error
d) Cannot be determined

10. To delete one variable but not the entire workspace, we need to mention the variable name after the clear command.
a) True
b) False

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Reply

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

Previous post Z Transform – 2 MCQ’s
Next post Data Classes MCQ’s