function [na jl jh]=pna_trun(m,b,bigt)

% This code compute the degrees of freedom of each segment (nA)

na=zeros(m+1,1);
jl=zeros(m+1,1);
jh=zeros(m+1,1);

n=b(1,1);

L=trun_rule(n);

jl(1,1)=L;
jh(1,1)=n;

i=2;
while i <= m
    n=b(i,1)-b(i-1,1);
    L=trun_rule(n);
    jl(i,1)=L;
    jh(i,1)=n;
    i=i+1;
end
n=bigt-b(m,1);
L=trun_rule(n);
jl(m+1,1)=L;
jh(m+1,1)=n;
na=jh-jl;