I am not sure how to use the nargin function. I wanted to take a variable number of input arguments and return a sum of those arguments. I am stuck. I have this code so far
function [ output_args ] = addmany() %This function will take zero or more numbers as a variable number of input %arguments and returns the sum of its input arguments. n=nargin; %number of input arguments sum
Not sure how to get a sum of the variable input arguments
Best Answer