%% Fit data to inverse tangent function
%Y = atan(x*a/b/(a^2-x^2));

%clear all; close all; clc;

%x = [0.7 0.8 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2 2.1 2.2 2.3 2.4,2.6];
%y = [10 11 15 15 15 17 20 25 34 47 75 100 140 155 162 170 171 176];

%modelfun = @(b,x) b(1) * (pi/2 + atan((x - b(2))/b(3)));
%modelfun2 = @(c,x) ((1/pi) * atan(c(1) * (x-c(2)))+c(3));
%beta0=[0,0,0];
%plot(x,y,'bo'); hold on; plot(nlinfit(x,y,modelfun,beta0));