-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC.m
27 lines (26 loc) · 756 Bytes
/
C.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
function [ C ] = C( N,X )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
[ l1,l2,l3,het,b ] = structure_parameters();
[ c ] = constants();
b1 = l1.b;
b2 = l1.b+l2.b;
for i=1:N+1
if(X(i) <= b(1))
C(i) = l1.N; % Nd
elseif(X(i) <= b(1)+b(2))
C(i) = l2.N;
elseif(X(i) <= b(1)+b(2)+b(3))
C(i) = l2.N;
elseif(X(i) <= b(1)+b(2)+b(3)+b(4))
C(i) = l2.N;
elseif(X(i) <= b(1)+b(2)+b(3)+b(4)+b(5))
C(i) = l2.N;
elseif(X(i) <= b(1)+b(2)+b(3)+b(4)+b(5)+b(6))
C(i) = l2.N;
elseif(X(i) <= b(1)+b(2)+b(3)+b(4)+b(5)+b(7))
C(i) = -l3.N;
end
end
C = C;
end