Curve fitting with 5 variables
Afficher commentaires plus anciens
Dear Matlab experts,
I want to code curve fitting with 5 variables.
I got this message from Matlab, "Too many input arguments."
I added my code here, and I want to know how to solve this problem.
Thank you in advance.
Sincerely yours,
Redwood
%%Fit: 'China'.
[xData, yData, wData, cData, zData] = prepareSurfaceData( x, y, w, c, z );
% Set up fittype and options.
ft = fittype( 'a+ b*x +c*y + d*w + e*c', 'independent', {'x', 'y', 'w', 'c'}, 'dependent', 'z' );
opts = fitoptions( ft );
opts.Display = 'Off';
opts.Lower = [0 0 0 0 0];
opts.StartPoint = [0.01 0.01 0.01 0.01 0.01];
opts.Upper = [Inf Inf Inf Inf Inf];
% Fit model to data.
[fitresult, gof] = fit( [xData, yData, wData, cData], zData, ft, opts );
5 commentaires
Walter Roberson
le 15 Avr 2013
Which line is reporting too many input arguments?
Which MATLAB version are you using?
Redwood
le 15 Avr 2013
Image Analyst
le 15 Avr 2013
Answer his first question so he can help you. Copy and paste all the red error text that you are getting.
Redwood
le 15 Avr 2013
Walter Roberson
le 15 Avr 2013
prepareSurfaceData's changes are specifically documented; you can undertake them yourself; see http://www.mathworks.com/help/curvefit/preparesurfacedata.html
Réponses (1)
Valeria Alejandra
le 6 Sep 2024
Modifié(e) : Valeria Alejandra
le 6 Sep 2024
0 votes
Catégories
En savoir plus sur Get Started with Curve Fitting Toolbox dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!