curve fit for 4 variables, error 'not enough input arguments'
1 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
Geoff Hayes
2015 年 7 月 5 日
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?
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Linear and Nonlinear Regression についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!