curve fit for 4 variables, error 'not enough input arguments'

2 Ansichten (letzte 30 Tage)
Wu Ying
Wu Ying am 5 Jul. 2015
Kommentiert: Geoff Hayes am 5 Jul. 2015
function [fitresult, gof] = createFit(CO2NonWorkZone, diveIRI, CO2WorkZone,diffeIRI)
[xData, yData, zData, gData] = prepareData( CO2NonWorkZone, diveIRI, CO2WorkZone, diffeIRI );
ft = fittype( 'a + c*x*g*exp(w*y)', 'independent', {'x', 'y','g'}, 'dependent', 'z' );
opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
opts.Display = 'Off';
opts.StartPoint = [0.371420685802539 0.0606895470210004 0.376869074010979];
% Fit model to data.
[fitresult, gof] = fit( [xData, yData, gData], zData, ft, opts );
figure( 'Name', 'untitled fit 1' );
h = plot( fitresult, [xData, yData, gData], zData );
legend( h, 'untitled fit 1', 'CO2WorkZone vs. CO2NonWorkZone, diveIRI, diffeIRI', 'Location', 'NorthEast' );
xlabel( 'CO2NonWorkZone' );
ylabel( 'diveIRI' );
zlabel( 'CO2WorkZone' );
glabel( 'diffeIRI' );
grid on
  1 Kommentar
Geoff Hayes
Geoff Hayes am 5 Jul. 2015
Wu - please include the full error message (all text that is in red) so that we can get an idea of which line is generating the error message. Is it the call to createFit? Also, is this function the one from the File Exchange at here?

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by