adplus-dvertising
frame-decoration

Question

What are the contents of a and b after the following events?
Line 1: function p=avg(x)
Line 2: n = length(x);
Line 3: n=n+3
Command Window: 
>> x=[1 2 3 5]
>> dbstop in avg if length(x)>4
>> a=avg(x);
>> x=[1 2 3 4 5];
>> b=avg(x);

a.

Error in the function

b.

a=4,b=5

c.

Enters debugging mode at b but a=4

d.

Outputs are suppressed

Posted under MATLAB

Answer: (b).a=4,b=5

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What are the contents of a and b after the following events?

Similar Questions

Discover Related MCQs

Q. The debug commands can be run in

Q. The dbstop command, for functions stored in the system memory, with a line mentioned will __________

Q. The dbcont command, if placed in an m.file, will __________

Q. The dbquit command, if placed in an m.file, will __________

Q. The dbstop command, for anonymous functions __________

Q. What is dbstop command?

Q. Which of the following command would allow us to continue the evaluation of a function in the debugging mode?

Q. To end the debugging mode, we use the __________

Q. To enter a value and change the course of working of a function while it is working, we use the __________

Q. Can we save a MATLAB program while in debugging mode?

Q. How much does the precision change while finding sin(x) using evalc and eval?

Q. Which function gets disabled while using evalc()?

Q. The input to the evalc command is given using {}.

Q. The input to the eval command is given using [].

Q. The eval command can evaluate __________

Q. The feval command can evaluate __________

Q. What is common to evalc and the eval commands, apart from the output?

Q. The evalc function is different from the eval command ________

Q. The for keyword can be used to evaluate expressions using eval().

Q. The disp() command cannot print anything but inputs given within string arguments.