I am creating a function that perform multiple regression in MATLAB. The function is created as
function [Beta] = george_linreg(y,x1,x2,x3,....,xN).
I don't know before hand how many explanatory variables there will be $\bf(x_i)$. How do I go about creating a function where any number of $\bf(x_i)$ can be inputted?
Thanks
Check out the documentation on
narginandvarargin.