Line | |
---|
1 | close all;clear all;clc
|
---|
2 | x0=[5.1 5.2 5.3 5.4 5.5 5.6 5.7 5.8 5.9 6.0 6.1]*7.94;%mm
|
---|
3 | Ibeam=-[630 630 630 630 630 626 612 540 360 150 0]+630; %mV
|
---|
4 | f = fit(x0',Ibeam','gauss1')
|
---|
5 | A=f.a1;
|
---|
6 | Xpos=f.b1;
|
---|
7 | Sigma_b=f.c1/sqrt(2);
|
---|
8 | figure;
|
---|
9 | plot(x0,Ibeam,'ok','linew',2)
|
---|
10 | x=min(x0):0.1:max(x0)+1;
|
---|
11 | hold on
|
---|
12 | Gauss=A.*exp(-((x-Xpos)/(sqrt(2)*Sigma_b)).^2);
|
---|
13 | plot(x,Gauss,'r','linew',2)
|
---|
14 | % set(gca,'fontsize',16)
|
---|
15 | grid on
|
---|
16 | legend('Data','Gauss fit',2)
|
---|
17 | title(['x_{pos}=' num2str(Xpos) ' mm; \sigma=' num2str(Sigma_b) ' mm '])
|
---|
18 | xlabel('Grating position, [mm]')
|
---|
19 | ylabel('Amplitude, [a.u.]') |
---|
Note: See
TracBrowser
for help on using the repository browser.