MATLAB: How to move fitted plot along y axis

cftool

Hey, it's me again, this time I want to shift a fit I created with cftool:
[xData, yData] = prepareCurveData( Fqr, Prem );
% Set up fittype and options.
ft = fittype( 'a*atan(2*b*t/3.83^2-t^2)', 'independent', 't', 'dependent', 'y' );
opts = fitoptions( 'Method', 'NonlinearLeastSquares' );
opts.Display = 'Off';
opts.StartPoint = [0.0496544303257421 0.902716109915281];
% 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,'x');
set(h,'LineWidth',2,'Markersize',7.5)
legend( h, 'Prem vs. Fqr', 'untitled fit 1', 'Location', 'NorthEast', 'Interpreter', 'none' );
% Label axes
xlabel( 'Fqr', 'Interpreter', 'none' );
ylabel( 'Prem', 'Interpreter', 'none' );
grid on
I manage to relcoate y values just by typing +pi/2 behind yData, but what about the fitted line? That's where I'm struggling.

Best Answer

Why not just shift up the raw y data?
[xData, tmp] = prepareCurveData( Fqr, Prem );
yData = tmp+pi/2; % shift up your y data values
Then everything else would be the same as you had.