Home > pubtools > LatticeTuningFunctions > errors > errorsmanipulation > getMagGroupsFromGirderIndex.m

getMagGroupsFromGirderIndex

PURPOSE ^

SYNOPSIS ^

function maggroups=getMagGroupsFromGirderIndex(r)

DESCRIPTION ^

 output maggroups in r with indexes between GS and GE markers.

 maggroups is a cell array of magnet indexes describing a single magnet in
 reality, but sliced in the lattice
 a single magnet has the same MagNum value.
 
see also: UniformGirderErrors

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function maggroups=getMagGroupsFromGirderIndex(r)
0002 %
0003 % output maggroups in r with indexes between GS and GE markers.
0004 %
0005 % maggroups is a cell array of magnet indexes describing a single magnet in
0006 % reality, but sliced in the lattice
0007 % a single magnet has the same MagNum value.
0008 %
0009 %see also: UniformGirderErrors
0010 
0011 indGS=find(atgetcells(r,'FamName','GS'));
0012 indGE=find(atgetcells(r,'FamName','GE'));
0013 
0014 maggroups=arrayfun(@(a,b)makegroup(a,b),indGS,indGE,'un',0);
0015 
0016 return
0017 
0018 function g=makegroup(a,b)
0019 g=a:1:b;
0020 return

Generated on Thu 24-Aug-2017 18:47:33 by m2html © 2005