Que.What is the output of the following command?function s= average(varargin)
celldisp(varargin)
s=sum(varargin)
end
p=average(1:3)
|
a. Error in sum |
b. Error using varargin in function definition |
c. Error calling the average function |
d. 1 2 3p=6 |
Que.What is the output of the following command?function wish= ful(p,varargin)
celldisp(p)
wish=sin(varargin{1})
end
p=ful(1:3)
|
a. Error in calling the function |
b. Error in celldisp |
c. Error in the function definiton |
d. Error in the wish variable |
Que.What is the output of the following command?function mad= heart(p,varargin)
disp(p)
wish=sin(varargin{0})
end
p=heart(1:3,0)
|
a. Error in wish command |
b. Error while calling heart command |
c. Error while calling disp command |
d. 1 2 3wish=0 |
Que.What is the output of the following command?function mad= rush(p,varargin)
disp(p)
wish=cos(varargin[0])
end
p=rush(1:3,pi/2)
|
a. Error due to element index |
b. Error due to syntax of varargin |
c. 1 2 3wish=0 |
d. Error due to disp() |
Error due to syntax of varargin
Que.What is the output of the following code?function mad= rush(p,varargin)
disp(p)
wish=cos(varargin{1})
end
p=rush(1:3,Inf)
|
a. Error due to Inf |
b. -1 |
c. p{1}= 1 2 3wish=0 |
d. p{1}= 1 2 3wish=NaN |
Que.What is the output of the following code?function maha= orchid(polo,varargin)
disp(polo)
wish=sum(varargin{1,2})
end
p=rush(-1:1,Inf)
|
a. Logical error in varargin |
b. Syntactical error in varargin |
c. p{1}=-1 0 1wish=0 |
d. No output |
Logical error in varargin
Que.What is the output of the following code?function [die,absdif] = BDO(y,x)
die = y-x;
if nargout > 1
disp('Boo !')
absdif = abs(die);
end
end
[p,q]=BDO(Inf,Inf)
|
a. Boo!p=NaNq=NaN |
b. Boo!p=0q=0 |
c. Error |
d. p=NaN |
Que.What is the output of the following code?function [die,af] = Bod(y,x)
die = y*x;
if nargout < 1
error('Boo !')
else
disp(‘Yo !’)
af = abs(die);
end
end
[p]=Bod(1,[1 -2])
|
a. Error with Boo! displayed |
b. Yo !p=1 |
c. Yo !p=2 |
d. Yo !p=-2 |
Que.What is the output of the following code?function [die,af] = lola(y,x)
die = y*x;
if nargout < 1
error('Boo !')
else
disp(‘Yo !’)
af = abs(die);
end
end
p=lola(1,[1 -2])
|
a. Error with Boo ! written |
b. Yo !p=-2 |
c. Boo !p=-1 |
d. Boo !p=1 |
Que.A function ______________
|
a. can be run in the command window by defining it in the window itself |
b. can be run in the command window by defining it in a cpp file |
c. can be run in the command window by defining it in a script file |
d. can be run in the script file by defining it in the command window |
can be run in the command window by defining it in a script file