forked from OpenWaterAnalytics/epanet-matlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathENsetpattern.m
executable file
·35 lines (34 loc) · 1.06 KB
/
ENsetpattern.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
function [errcode] = ENsetpattern(index, factors, nfactors)
% Declaration:
% [errcode] = ENsetpattern(index, factors, nfactors)
%
% Description:
% Sets all of the multiplier factors for a specific time pattern.
%
%Arguments:
% index: time pattern index
% factors: multiplier factors for the entire pattern
% nfactors: number of factors in the pattern
%
% Returns:
% Returns an error code.
%
%Notes:
% Pattern indexes are consecutive integers starting from 1.
%
% factors points to a zero-based array that contains nfactors elements.
%
% Use this function to redefine (and resize) a time pattern all at once;
% use ENsetpatternvalue to revise pattern factors in specific time periods of a pattern.
%
%See Also:
% ENgetpatternindex, ENgetpatternlen, ENgetpatternvalue,
% ENsetpatternvalue, ENaddpattern
%
% Version 2.00.07 (August 2008)
global ENDLLNAME;
index=int32(index);
nfactors=int32(nfactors);
p=libpointer('singlePtr',factors);
[errcode]=calllib(ENDLLNAME,'ENsetpattern',index,p,nfactors);
if errcode ENerror(errcode); end