# Plotting the following function in one dimensional space R

2 views (last 30 days)
Reza Yaghmaeian on 26 Feb 2022
Answered: Reza Yaghmaeian on 26 Feb 2022
I want to plot the following function in one dimensional space :
Let and an integer. For each probability vector ( ) with for we set: , , .
Let τ be the permutation of the symbols . Then : is a probability vector with positive components, and we can form the corresponding and , .i.e: and . Now we define the main function I want to plot : where for each and each .
---
How could I write the above function on matlab and also how could I plot it in one dimensional space ?

Reza Yaghmaeian on 26 Feb 2022
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