Plotting the following function in one dimensional space R

4 vues (au cours des 30 derniers jours)
Reza Yaghmaeian
Reza Yaghmaeian le 26 Fév 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 ?

Réponses (1)

Reza Yaghmaeian
Reza Yaghmaeian le 26 Fév 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

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by