What is the output of the following command? [code]function eclairs= honey(p,q) narginchk(2,5) disp(‘Yo, G!’) c=q+p; end honey(1)[/code]

What is the output of the following command?
Code:
function eclairs= honey(p,q)
narginchk(2,5)
disp(‘Yo, G!’)
c=q+p;
end
honey(1)
A. Syntactical Error
B. Yo, G!
C. input error
D. 2 3 4 5
 
Answer: c
Explanation: The minimum number of inputs as suggested by the narginchk keyword is 2. But we have given only 1 input to the narginchk keyword. Hence, MATLAB gives an error in the input given to the function honey().
 

Tìm kiếm

Back
Top