MATLAB: Creating an Array for Different Radial Positions

MATLAB

I am basically looking to take a point in spherical polar coordinates such that theta = 0, phi = pi/2 and r = 1, then extend outwards at the same angles but increasing the radius by 0.2 each time until a radius of 10 is reached.
Corresponding to each of these points on a radial line, I then need a 3 x 46 array such that each 3 x 1 vector in the array corresponds to the position of each of the consecutive radial points in Cartesian coordinates, what would be the easiest way of doing this? Please let me know if this is not clear.

Best Answer

theta = 0;
phi = pi/2;
r = 1 : 0.2 : 10;
theta = repmat(theta,size(r));
phi = repmat(phi, size(r));
[x,y,z] = sph2cart(theta,phi,r);
xyz = [x; y; z];