Plotting the following function in one dimensional space R

조회 수: 2 (최근 30일)
Reza Yaghmaeian
Reza Yaghmaeian 2022년 2월 26일
답변: Reza Yaghmaeian 2022년 2월 26일
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 ?

답변 (1개)

Reza Yaghmaeian
Reza Yaghmaeian 2022년 2월 26일
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

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by