I did it myself. So if any body needs it, here it is:
clear all
clc
N=11;%9;%7;
d=0.5;
r=zeros(N,3);
x=[0 d:d:(N-1)/2*d zeros(1,(N-1)/2)]';%x=[0 d 2*d 3*d 0 0 0]';%x=[0 0.5 1 1.5 0 0 0]';
y=[zeros(1,(N+1)/2) d:d:(N-1)/2*d]';%y=[0 0 0 0 d 2*d 3*d]';%y=[0 0 0 0 0.5 1 1.5]';
z=zeros(1,N)';%z=[0 0 0 0 0 0 0]';
r=[x y z]