[xData1, tmp] = prepareCurveData( Fqr, Prem );
yData1 = tmp+pi/2;
ft = fittype( 'a*atan(2*b*t/3.83^2-t^2)+pi/2', 'independent', 't', 'dependent', 'y' );
opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
opts.Display = 'Off';
opts.StartPoint = [0.0496544303257421 0.902716109915281];
[fitresult1, gof1] = fit( xData, yData, ft, opts );
h(1) = plot( fitresult1, xData1, yData1,'x');
[xData2, tmp] = prepareCurveData( Fq2r, Prem2 );
yData2 = tmp+pi/2;
opts.StartPoint = [0.425259320214135 0.312718886820616];
[fitresult2, gof2] = fit( xData2, yData2, ft, opts );
hold on
h(2) = plot( fitresult2, xData2, yData2 );
set(h,'LineWidth',2,'Markersize',7.5)
grid on
legend({'Phasenverschiebung','Fit: $(-1,02 \pm 0,07) \cdot \tan^{-1}(\frac{2\cdot (27,59 \pm 0,27)\cdot \omega}{3,83^2-\omega^2})$'}, ...
{'Phasenverschiebung bei $I = 0,25 A$','Fit: $(-1,26 \pm 0,20) \cdot \tan^{-1}(\frac{2\cdot (26,59 \pm 0,65)\cdot \omega}{3,83^2-\omega^2})$'}, ...
'Interpreter','latex','FontSize',14)
xlabel({'$\omega$ in rad'},'Interpreter','latex','FontSize',14)
ylabel({'Phasenverschiebung $\Delta \varphi$ in rad'},'Interpreter','latex','FontSize',14)
3 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/554215-how-to-combine-2-fits-done-with-cftool#comment_912310
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/554215-how-to-combine-2-fits-done-with-cftool#comment_912310
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/554215-how-to-combine-2-fits-done-with-cftool#comment_913024
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/554215-how-to-combine-2-fits-done-with-cftool#comment_913024
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/554215-how-to-combine-2-fits-done-with-cftool#comment_913141
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/554215-how-to-combine-2-fits-done-with-cftool#comment_913141
Sign in to comment.