K Khang Lê New member Sep 19, 2021 #1 What is the output of the following command? Code: function pu= hu(p,varargin) narginchk(0,1) disp(‘Stick!’) o=sin(varargin{1}); end ola(1,p/2) A. Error due to line 2 B. Error due to line 5 C. Error due to syntax D. Stick! o=1
What is the output of the following command? Code: function pu= hu(p,varargin) narginchk(0,1) disp(‘Stick!’) o=sin(varargin{1}); end ola(1,p/2) A. Error due to line 2 B. Error due to line 5 C. Error due to syntax D. Stick! o=1
S Sơn Lê Member Sep 19, 2021 #2 Answer: a Explanation: The varargin command restricts the input to the function to only 1 argument. Hence, the function stops working and we will get an error due to line 2 of the above code. Upvote 0 Downvote
Answer: a Explanation: The varargin command restricts the input to the function to only 1 argument. Hence, the function stops working and we will get an error due to line 2 of the above code.