필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how to represent my outcomes from a multinomial distribution in terms of y=1:10

조회 수: 1 (최근 30일)
oshomah kanoba
oshomah kanoba 2015년 3월 28일
마감: MATLAB Answer Bot 2021년 8월 20일
clc
clear all
format compact
rng(970,'v4')
X=[];
X1=[];
X2=[];
X3=[];
U=[];
p =[0.0080 0.0270 0.1250 0.0360 0.0600 0.1350 0.2250 0.0540 0.1500 0.1800];
Y=1:10;
for i = (1:10000)
r =rand;
if r<0 & r<=0.0080
x1=0; x2=0; x3=3;
Y=1;
X1=[x1];X2=[x2];X3=[x3];
U=[U,r];
else if r>0.0080 & r<=0.0350
x1=0; x2=3; x3=0;
Y=2;
X1=[x1];X2=[x2];X3=[x3];
U=[U,r];
else if r>0.0350 & r<=0.1600
x1=3; x2=0; x3=0;
Y=3;
X1=[x1];X2=[x2];X3=[x3];
U=[U,r];
else if r>0.1600 & r<=0.1960
x1=0; x2=1; x3=2;
Y=4;
X1=[x1];X2=[x2];X3=[x3];
U=[U,r];
else if r>0.1960 & r<=0.2560
x1=1; x2=0; x3=2;
Y=5;
X1=[x1];X2=[x2];X3=[x3];
U=[U,r];
else if r>0.2560 & r<=0.3910
x1=1; x2=2; x3=0;
Y=6;
X1=[x1];X2=[x2];X3=[x3];
U=[U,r];
else if r>0.3910 & r<=0.6160
x1=2; x2=1; x3=0;
Y=7;
X1=[x1];X2=[x2];X=[x3];
U=[U,r];
else if r>0.6160 & r<=0.6700
x1=0; x2=2; x3=1;
Y=8;
X1=[x1];X2=[x2],X3=[x3];
U=[U,r];
else if r>0.6700 & r<=0.8200
x1=2; x2=0; x3=1;
Y=9;
X1=[x1];X2=[x2],X3=[x3];
U=[U,r];
else if r>0.8200 & r<=1
x1=1; x2=1; x3=1;
Y=10;
X1=[x1];X2=[x2];X3=[x3];
U=[U,r];
end
end
end
end
end
end
end
end
end
end
end

답변 (0개)

이 질문은 마감되었습니다.

제품

Community Treasure Hunt

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

Start Hunting!

Translated by