[gelöst] fit scheitert mit 'Matrix dimensions must agree'
pospiech
Forum-Century
Beiträge: 130
Anmeldedatum: 03.09.07
Wohnort: ---
Version: ---
Verfasst am : 14.12.2010, 15:57
Titel : [gelöst] fit scheitert mit 'Matrix dimensions must agree'
Dieser Code
Code:
FitOptions = fitoptions ( 'method ','NonlinearLeastSquares ','Lower ',[ FitStartValues( 1 ) -Inf 0 ] ) ;
%
set ( FitOptions ,'Startpoint ',FitStartValues) ;
% a1 * exp(- ( (x-b1)/c1 )2 )
% FitFunction = fittype('gauss1');
if ( fitzero)
FitFunction = fittype ( '0 + a1 * exp ( - ( ( x-b1) /c1 ) 2 ) ',...
'dependent ',{ 'y '} ,'independent ',{ 'x '} ,...
'coefficients ',{ 'a1 ', 'b1 ', 'c1 '} ) ;
else
FitFunction = fittype ( 'y0 + a1 * exp ( - ( ( x-b1) /c1 ) 2 ) ',...
'dependent ',{ 'y '} ,'independent ',{ 'x '} ,...
'coefficients ',{ 'a1 ', 'b1 ', 'c1 ','y0 '} ) ;
end
% Fit this model
size ( XAXIS')
size ( YDATA')
FitFunction
FitOptions
FitFunction = fit ( XAXIS',YDATA',FitFunction,FitOptions ) ;
liefert den Fehler:
Zitat:
??? Error using ==> minus
Matrix dimensions must agree.
Error in ==> fit at 452
errstr = handleerr(es.identifier, es.message, suppresserr); return;
was für mich überhaupt keinen Sinn ergibt, wenn man sich diese Ausgabe anschaut:
Zitat:
ans = 465 1
ans = 465 1
FitFunction =
General model:
FitFunction(a1,b1,c1,y0,x) = y0 + a1 * exp(- ( (x-b1)/c1 )2 )
FitOptions =
Normalize: 'off'
Exclude: []
Weights: []
Method: 'NonlinearLeastSquares'
Robust: 'Off'
StartPoint: [1 0.0500 1]
Lower: [1 -Inf 0]
Upper: [1x0 double]
Algorithm: 'Trust-Region'
DiffMinChange: 1.0000e-008
DiffMaxChange: 0.1000
Display: 'Notify'
MaxFunEvals: 600
MaxIter: 400
TolFun: 1.0000e-006
TolX: 1.0000e-006
Ideen ?
Zuletzt bearbeitet von pospiech am 14.12.2010, 16:16, insgesamt einmal bearbeitet
pospiech
Themenstarter
Forum-Century
Beiträge: 130
Anmeldedatum: 03.09.07
Wohnort: ---
Version: ---
Verfasst am : 14.12.2010, 16:16
Titel :
Es lag an den Startwerten. Gelöst durch
Einstellungen und Berechtigungen
Du kannst Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
Impressum
| Nutzungsbedingungen
| Datenschutz
| FAQ
| RSS
Hosted by:
Copyright © 2007 - 2025
goMatlab.de | Dies ist keine offizielle Website der Firma The Mathworks
MATLAB, Simulink, Stateflow, Handle Graphics, Real-Time Workshop, SimBiology, SimHydraulics, SimEvents, and xPC TargetBox are registered trademarks and The MathWorks, the L-shaped membrane logo, and Embedded MATLAB are trademarks of The MathWorks, Inc.