Convert a 1D array into a 'rotated' 2D matrix simply put, let's say I have this array - [1 2 1]
I want to try and get this output in Matlab

[1 1 1
1 2 1
1 1 1]

It's like my array was 'rotated' into forming the above matrix such that if I start at any peripheral element and move through the center of the matrix (in a straight line of course) towards the other end, then I get back my original array ( [1 2 1] )
Can anyone help me achieve this?
I assume that the length of the array is odd and that the array is symmetrical. Also note that from your requirements not all elements of the resulting matrix are specified. Those elements will be zero in the code shown below.

v=[1,2,3,2,1];      % odd-length array
A=diag(v);
A=A+rot90(A);
n=(length(v)+1)/2;
A(n,:)=v;
A(:,n)=v;
A =

1   0   1   0   1
0   2   2   2   0
1   2   3   2   1
0   2   2   2   0
1   0   1   0   1