Last change
on this file was
4,
checked in by zhangj, 11 years ago
|
Initial import--MML version from SOLEIL@2013
|
File size:
932 bytes
|
Line | |
---|
1 | %========================================================== |
---|
2 | function 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 | |
---|
12 | delta=varargin{1}; %compressed |
---|
13 | act =varargin{2}; |
---|
14 | indx =varargin{3}; %indices for array compression |
---|
15 | lim =varargin{4}; |
---|
16 | name =varargin{5}; |
---|
17 | |
---|
18 | |
---|
19 | varargout{1}=0; |
---|
20 | for 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 |
---|
25 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.