You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to apply a Fourier model fit on some data, but the result using Matlab curve fiitting toolbox is so different comparing that I have using pymodelfit.
this is the code using Matlab curve fitting:
function [fitresult, gof] = createFit2()
x =1:200;
y2 = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,9,10,10,10,10,15,15,15,18,18,18,18,20,20,20,20,20,22,22,22,22,22,22,22,21,21,12,15,16,22,22,23,23,23,20,21,15,15,14,13,11,11,17,17,15,14,14,18,19,19,19,13,9,16,16,16,16,16,14,14,14,6,6,12,11,11,9,9,9,9,3,3,3,3,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
[xData, yData] = prepareCurveData( x, y2);
% Set up fittype and options.
ft = fittype( 'fourier2');
opts = fitoptions( ft );
opts.Display ='Off';
opts.Lower = [-Inf-Inf-Inf-Inf-Inf-Inf];
opts.StartPoint = [000001.82746553632962];
opts.Upper = [InfInfInfInfInfInf];
opts.Normalize ='on';
% Fit model to data.
[fitresult, gof] = fit( xData, yData, ft, opts);
% Plot fit with data.
figure( 'Name', 'untitled fit 1' );
h = plot( fitresult, xData, yData);
legend( h, 'y2 vs. x', 'untitled fit 1', 'Location', 'NorthEast' );
% Label axes
xlabel( 'x' );
ylabel( 'y2' );
gridon
Hi,
I'm trying to apply a Fourier model fit on some data, but the result using Matlab curve fiitting toolbox is so different comparing that I have using pymodelfit.
this is the code using Matlab curve fitting:
this is the code using python and pymodelfit:
any idea?
thanks
The text was updated successfully, but these errors were encountered: