Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
Wu Ying
Wu Ying el 5 de Jul. de 2015
Comentada: Geoff Hayes el 5 de Jul. de 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 comentario
Geoff Hayes
Geoff Hayes el 5 de Jul. de 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?

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Get Started with Curve Fitting Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by