MATLAB: Generate vector from fixed point

fixedgenerateinterpolationpointvector

I have a 1×35 array, i want to generate a vector 1×31822 interpolating from the 35 points of the first vector, in a way that the two vectors could have the same shape.
which is the best method?
thanks

Best Answer

Read about interp1.
th = linspace(0,2*pi,35) ;
y = sin(th) ;
figure
hold on
plot(th,y,'.r')
%%interpolation
thi = linspace(min(th),max(th),31822) ;
yi = interp1(th,y,thi) ;
plot(thi,yi,'b') ;