source: MML/trunk/applications/orbit/lib/curlim.m @ 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: 932 bytes
Line 
1%==========================================================
2function varargout = curlim(varargin)
3%==========================================================
4%check to see if element values are within limit
5%varargin contains arrays
6%1. delta (change in currents)                         COMPRESSED
7%2  act (actual currents)                            UNCOMPRESSED
8%3. indx (index of elements to check)                  COMPRESSED
9%4. lim (current limits)                             UNCOMPRESSED
10%5. name (element names)                             UNCOMPRESSED
11
12delta=varargin{1};    %compressed
13act  =varargin{2};
14indx =varargin{3};    %indices for array compression
15lim  =varargin{4};
16name =varargin{5};
17
18
19varargout{1}=0;
20for ii=1:length(indx)
21  if abs(act(indx(ii))+delta(ii))>=lim(indx(ii))
22  disp(['Warning: element value out of range: ' name(indx(ii),:)]);
23  varargout{1}=1;                %out of range value flag
24  end
25end
Note: See TracBrowser for help on using the repository browser.