Adding a function to the distribution of a matrix.
2 views (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!