How to create a matrix out of a radial distribution vector

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

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
Thanks for the fast answer. Unfortunately this is not what I am looking for. It kind of works for the kind of vector I proposed in example but not for a more complex vector. For example:
V = [6 0 0 0 6]
M = [0 4 6 4 0
4 2 0 2 4
6 0 0 0 6
4 2 0 2 4
0 4 6 4 0]
It is a circle from a radial distribution vector, with interpolated coefficients when not on the horizontal and vertical axis.

Sign in to comment.

Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Asked:

on 5 May 2013

Community Treasure Hunt

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

Start Hunting!