File: check_limits.m

package info (click to toggle)
openems 0.0.35%2Bgit20190103.6a75e98%2Bdfsg.1-3.2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 8,544 kB
  • sloc: cpp: 40,417; python: 2,028; yacc: 580; makefile: 459; lex: 350; sh: 176; ruby: 19
file content (22 lines) | stat: -rw-r--r-- 379 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function pass = check_limits( Z, upper_limit, lower_limit )

% make row vector
if size(Z,1) ~= 1
    Z = Z.';
end

if numel(upper_limit) == 1
    upper_limit = upper_limit * ones(1,size(Z,2));
end
if numel(lower_limit) == 1
    lower_limit = lower_limit * ones(1,size(Z,2));
end


pass = 1;
if any( Z > upper_limit )
    pass = 0;
end
if any( Z < lower_limit )
    pass = 0;
end