It sounds like you need to be using interp1
in a loop (i.e. to preserve original order) interpolating between each consecutive pair of points:
X = [10; 10.0001; 9; 48]; %// You can consider something like X = [10;10;9;48]; X=X+rand(size(X))*0.0001 instead of dealing with equal X values manually
Y = [10; 20; 50; 6];
m = 3333; %//num points between nodes
n = m*(length(X)-1);
Yi = zeros(n,1);
Xi = [];
for k = 1:length(X)-1
xi = linspace(X(k), X(k+1), m);
Xi = [Xi, xi];
Yi(((k-1)*m+1):k*m) = interp1(X(k:k+1), Y(k:k+1),xi);
end
plot(X,Y,'or');
hold on
plot(Xi,Yi);
To get a pentagon (not a W) try this looping code with these inputs:
X = [0.25; 0.75; 1; 0.5; 0; 0.25];
Y = [0; 0; 1; 1.8; 1; 0];
Result: