READ THE HELP.
For example, a fragment of the help for fitnlm:
NLM = fitnlm(X,Y,MODELFUN,BETA0) fits a nonlinear regression model
using the column vector Y as a response variable and the columns of the
matrix X as predictor variables.
So if you have TWO independent variables, they would be passed in as two columns of the ARRAY X.
As far as LSQNONLIN goes, it can handle any number of independent variables, because it only cares about the residual vector. You don't even pass in data to LSQNONLIN, just a function.
GLMFIT does not accept nonlinear models. But as long as the model is linear in the coefficients, there is no problem. It can still be nonlinear in the independent variable, since you pass in an array of data. And it does handle the case of multiple independent variables, since you must create the array X.
Of course, there is also NLINFIT, which is able to handle an array of multiple independent variables.
So basically, you need to read the help. Different tools handle a variety of problems.
Best Answer