I wrote the following but I have problem defining the function T:
clear all;
close all;
n=3
%r = rand(1, n); % Start with 3 random numbers that don't sum to 1.
%r = r / sum(r) % Normalize so the sum is 1.
%theSum = sum(r) % Check to make sure. Should be 1
alpha=[0.5 0.25 0.25]
%alpha=sort(r)
beta(1)=0;
for i=1:n
beta(i+1)=beta(i)+alpha(i);
end
for i=1:n
X(i) = fixed.Interval(beta(i), beta(i+1),'[)');
end
tau = [2 3 1];
% or you can define an anonymous function:
taut = [2,3,1]
alphat=[alpha(taut(1)), alpha(taut(2)) , alpha(taut(3))];
betat(1)=0;
for i=1:n
betat(i+1)=betat(i)+alphat(i);
end
for i=1:n
Xt(i) = fixed.Interval(betat(i), betat(i+1),'[)');
end