DEMOKNOB illustrates the use of MATLAB GUI controls with AT to modify several parameters in THERING In this case - quadrupole strength of QF and QD families This demo creates spear2 lattice and 2 control slider: for QF and for QD quadrupole families
0001 %DEMOKNOB illustrates the use of MATLAB GUI controls with AT 0002 % to modify several parameters in THERING 0003 % In this case - quadrupole strength of QF and QD families 0004 % This demo creates spear2 lattice 0005 % and 2 control slider: for QF and for QD quadrupole families 0006 0007 clear all 0008 close all 0009 spear2 0010 qflist = findcells(THERING,'FamName','QF'); 0011 qdlist = findcells(THERING,'FamName','QD'); 0012 QFW = 0.02; 0013 QDW = -0.02; 0014 0015 weights1 = num2cell(QFW*ones(size(qflist))); 0016 kn1 = struct('Position',num2cell(qflist),'FieldName','K','M',1,'N',1,'Weight',weights1); 0017 % When a value is changed, the PLOTBETA callback renews the beta-functions plot 0018 atslider(kn1,'Demo: Adjust QF','plotbeta'); 0019 %atslider(kn1,'Demo: Adjust QF'); 0020 0021 weights2 = num2cell(QDW*ones(size(qdlist))); 0022 kn2 = struct('Position',num2cell(qdlist),'FieldName','K','M',1,'N',1,'Weight',weights2); 0023 atslider(kn2,'Demo: Adjust QD','plotbeta'); 0024 %atslider(kn2,'Demo: Adjust QD');