K Khang Lê New member Sep 19, 2021 #1 What is the output of the following code? 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 3 wish=0 D. p{1}= 1 2 3 wish=NaN
What is the output of the following code? 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 3 wish=0 D. p{1}= 1 2 3 wish=NaN
P Phạm Thanh Nam New member Sep 19, 2021 #2 Answer: d Explanation: There is no error due to Inf. The disp function will display 1 2 3 due to the input vector 1:3 and wish will be assigned to NaN since cos(Inf) is NaN. Upvote 0 Downvote
Answer: d Explanation: There is no error due to Inf. The disp function will display 1 2 3 due to the input vector 1:3 and wish will be assigned to NaN since cos(Inf) is NaN.