source: MML/trunk/machine/SOLEIL/Booster/applications/profil_perte.m @ 17

Last change on this file since 17 was 17, checked in by zhangj, 10 years ago

To have a stable version on the server.

  • Property svn:executable set to *
File size: 491 bytes
Line 
1% profil de perte
2
3clear
4chambre=10;
5sig=3;
6zb=-2.;
7step=1;
8
9z= -1.5*chambre:step:1.5*chambre;
10ch=min(abs(chambre-z-zb),abs(-chambre-z-zb));
11for i=1:length(z)
12    x=z(i);
13    if (x+zb)>chambre
14        ch(i)=0;
15    elseif (x+zb)<-chambre
16        ch(i)=0;
17    end
18end
19profil=erf(ch/sqrt(2)/sig);
20
21profil=90*profil+ randn(size(z))*2;
22
23[estimates, model] = fitprofil(z, profil);
24estimates
25[sse, FittedCurve] = model(estimates);
26plot(z, profil, '*', z, FittedCurve, 'r');
27ylim([0 100])
28grid on
29
Note: See TracBrowser for help on using the repository browser.