source: MML/trunk/at/doc_html/at/atdemos/demoknob.html @ 4

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

Initial import--MML version from SOLEIL@2013

File size: 4.8 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2                "http://www.w3.org/TR/REC-html40/loose.dtd">
3<html>
4<head>
5  <title>Description of demoknob</title>
6  <meta name="keywords" content="demoknob">
7  <meta name="description" content="DEMOKNOB illustrates the use of MATLAB GUI controls with AT">
8  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
9  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
10  <meta name="robots" content="index, follow">
11  <link type="text/css" rel="stylesheet" href="../../m2html.css">
12</head>
13<body>
14<a name="_top"></a>
15<div><a href="../../index.html">Home</a> &gt;  <a href="../index.html">at</a> &gt; <a href="index.html">atdemos</a> &gt; demoknob.m</div>
16
17<!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
18<td align="right"><a href="index.html">Index for at/atdemos&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->
19
20<h1>demoknob
21</h1>
22
23<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
24<div class="box"><strong>DEMOKNOB illustrates the use of MATLAB GUI controls with AT</strong></div>
25
26<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
27<div class="box"><strong>This is a script file. </strong></div>
28
29<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
30<div class="fragment"><pre class="comment">DEMOKNOB illustrates the use of MATLAB GUI controls with AT
31   to modify several parameters in THERING
32   In this case - quadrupole strength of QF and QD families
33   This demo creates spear2 lattice
34   and 2 control slider: for QF and for QD quadrupole families</pre></div>
35
36<!-- crossreference -->
37<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
38This function calls:
39<ul style="list-style-image:url(../../matlabicon.gif)">
40<li><a href="atslider.html" class="code" title="function fig = atslider(varargin)">atslider</a> ATSLIDER is an example of a GUI control of multiple parameters in THERING</li><li><a href="spear2.html" class="code" title="function spear2">spear2</a> SPEAR2 example lattice definition file</li></ul>
41This function is called by:
42<ul style="list-style-image:url(../../matlabicon.gif)">
43<li><a href="talk.html" class="code" title="">talk</a>  TALK</li></ul>
44<!-- crossreference -->
45
46
47<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
48<div class="fragment"><pre>0001 <span class="comment">%DEMOKNOB illustrates the use of MATLAB GUI controls with AT</span>
490002 <span class="comment">%   to modify several parameters in THERING</span>
500003 <span class="comment">%   In this case - quadrupole strength of QF and QD families</span>
510004 <span class="comment">%   This demo creates spear2 lattice</span>
520005 <span class="comment">%   and 2 control slider: for QF and for QD quadrupole families</span>
530006
540007 clear all
550008 close all
560009 <a href="spear2.html" class="code" title="function spear2">spear2</a>
570010 qflist =  findcells(THERING,<span class="string">'FamName'</span>,<span class="string">'QF'</span>);
580011 qdlist =  findcells(THERING,<span class="string">'FamName'</span>,<span class="string">'QD'</span>);
590012 QFW =  0.02;
600013 QDW = -0.02;
610014
620015 weights1 = num2cell(QFW*ones(size(qflist)));
630016 kn1 = struct(<span class="string">'Position'</span>,num2cell(qflist),<span class="string">'FieldName'</span>,<span class="string">'K'</span>,<span class="string">'M'</span>,1,<span class="string">'N'</span>,1,<span class="string">'Weight'</span>,weights1);
640017 <span class="comment">% When a value is changed, the PLOTBETA callback renews the beta-functions plot</span>
650018 <a href="atslider.html" class="code" title="function fig = atslider(varargin)">atslider</a>(kn1,<span class="string">'Demo: Adjust QF'</span>,<span class="string">'plotbeta'</span>);
660019 <span class="comment">%atslider(kn1,'Demo: Adjust QF');</span>
670020
680021 weights2 = num2cell(QDW*ones(size(qdlist)));
690022 kn2 = struct(<span class="string">'Position'</span>,num2cell(qdlist),<span class="string">'FieldName'</span>,<span class="string">'K'</span>,<span class="string">'M'</span>,1,<span class="string">'N'</span>,1,<span class="string">'Weight'</span>,weights2);
700023 <a href="atslider.html" class="code" title="function fig = atslider(varargin)">atslider</a>(kn2,<span class="string">'Demo: Adjust QD'</span>,<span class="string">'plotbeta'</span>);
710024 <span class="comment">%atslider(kn2,'Demo: Adjust QD');</span></pre></div>
72<hr><address>Generated on Mon 21-May-2007 15:26:45 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> &copy; 2003</address>
73</body>
74</html>
Note: See TracBrowser for help on using the repository browser.