You provide the input pretty much the same way as for two variables. Assuming these vectors are column vectors, then:
mdl = polyfitn([input1,input2,input3],output,1);
If your data is in an array, then this will suffice:
mdl = polyfitn(data(:,2:4),data(:,1),1);
High order models will just get you in trouble, so don't go too high. I explicitly specified a linear model here for a good reason.
In fact, for the example data that you have shown, anything past a linear model in the second and third parameters will cause failure of the model, since quadratic terms in those parameters will be impossible to estimate. You could have a quadratic term in the first parameter though. You would need to explicitly state the terms to be used in the model then.
This should suffice, as the highest order set of terms that will not cause an error to result for the above set of data:
mdl = polyfitn([input1,input2,input3],output, ...
{'constant','x1','x1^2','x1^3','x2','x3'});
mdl
mdl =
ModelTerms: [6x3 double]
Coefficients: [-10.536 79.957 -186.3 157.69 0.7055 0.14157]
ParameterVar: [18.256 1398.4 18428 18532 1.2745 0.0097654]
ParameterStd: [4.2727 37.395 135.75 136.13 1.1289 0.09882]
DoF: 2
p: [0.13254 0.16594 0.30359 0.36635 0.59581 0.28834]
R2: 0.95897
AdjustedR2: 0.85641
RMSE: 0.53589
VarNames: {'x1' 'x2' 'x3'}
The model produced is...
vpa(polyn2sym(mdl),5)
ans =
157.69*x1^3 - 186.3*x1^2 + 79.957*x1 + 0.7055*x2 + 0.14157*x3 - 10.536
Even here, note the large coefficients on some of the terms. That immediately suggests this model is a poor one. Of course, I know that your data was just made up. mdl.p also indicates that none of the terms in this model are terribly well estimated. Terms that are significant in the model should have mdl.p very near zero for those coefficients.
For example:
mdl = polyfitn(rand(1000,1),rand(1000,1),4)
mdl =
ModelTerms: [5x1 double]
Coefficients: [0.95506 -2.2363 1.6668 -0.45408 0.55207]
ParameterVar: [3.7645 15.461 6.9479 0.42831 0.0022732]
ParameterStd: [1.9402 3.9321 2.6359 0.65446 0.047678]
DoF: 995
p: [0.62266 0.56966 0.5273 0.48796 3.5389e-29]
R2: 0.0021445
AdjustedR2: -0.001867
RMSE: 0.2884
VarNames: {'X1'}
Here the correct model for the above process is to use a constant only! All terms except for the constant term are statistically indistinct from zero, whereas the constant term was quite so.