Adding a function to the distribution of a matrix.
조회 수: 2 (최근 30일)
이전 댓글 표시
Hey all,
I've got a matrix (H) in this shape:
1 1 1 1 1 1
0 1 1 1 1 1
0 0 1 1 1 1
0 0 1 1 1 1
0 0 0 1 1 1
0 0 0 1 1 1
0 0 0 0 1 1
0 0 0 0 1 1
0 0 0 0 0 1
0 0 0 0 0 1
Now I want the vertical distribution to follow a Gaussian function, where the sum of a column = 1.
By hand, it'll look something like this:
1.0000 0.5000 0.1200 0.1000 0.0500 0.0300
0 0.5000 0.3800 0.1667 0.1050 0.0500
0 0 0.3800 0.3700 0.1750 0.1000
0 0 0.1200 0.3700 0.3250 0.1700
0 0 0 0.1667 0.3250 0.2800
0 0 0 0.1000 0.1750 0.2800
0 0 0 0 0.1050 0.1700
0 0 0 0 0.0500 0.1000
0 0 0 0 0 0.0500
0 0 0 0 0 0.0300
This is ofcourse a very bad approximation, but I hope you get the idea. How should I do this? I only get as far as giving them all an equal amount:
COLUMN=[];
for count=1:6
H(:,count)/sum(H(:,count));
COLUMN=[COLUMN, ans];
end
H=COLUMN;
Can someone perhaps give me some advice on how to add a (gaussian) function to a achieve a certain distribution? Thanks!
Tim
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!