How to create a matrix out of a radial distribution vector
Show older comments
I have a radial distribution vector and I would like to convert it into a matrix having the same distribution radially.
Example:
V=[1 3 4 3 1]
M=[0.1 0.7 1 0.7 0.1
0.7 1.7 3 1.7 0.7
1 3 4 3 1
0.7 1.7 3 1.7 0.7
0.1 0.7 1 0.7 0.1 ]
The values I've inserted are just an approximative interpolation to show the idea.
Is there a pre-made function for this or does it need to be coded, with the interpolation?
Thank you for the help!
2 Comments
Iman Ansari
on 5 May 2013
V=[1 3 4 3 1];
M=[1 3 4 3 1]'*[1 3 4 3 1]./V(ceil(length(V)/2))
M =
0.2500 0.7500 1.0000 0.7500 0.2500
0.7500 2.2500 3.0000 2.2500 0.7500
1.0000 3.0000 4.0000 3.0000 1.0000
0.7500 2.2500 3.0000 2.2500 0.7500
0.2500 0.7500 1.0000 0.7500 0.2500
Jean Jacques
on 5 May 2013
Answers (0)
Categories
Find more on Mathematics 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!