The answer to that question is Interpolation!.
However, you should not lengthen the value of Y, but decrease the value of X! The reason for this is that reducing the number of values in general has more precision than the other way around.
Obviously, interpolation exists because it is not always possible. That said, follow two examples.
Here I use the function interp1
, but there are others in the link I put before.
And a comment very important: There are many ways to make this interpolation, besides other functions you can use or not the pair (X,Y). Here I made it easier for me given your statement!
%dados
a=1:10
a=
1 2 3 4 5 6 7 8 9 10
%Aumentar
b=interp1(a,linspace(min(a),max(a),19))
b=
1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10
%diminuir
b=interp1(a,linspace(min(a),max(a),4))
b= 1 4 7 10
See that the numbers have been selected to be beautiful for this answer, but the function works with any value.
Another important comment is to know how the numbers are distributed. This method works well when the values are distributed homogeneously (1,2,3,4), but can give problems in another case (1,4,5,6). Interpolation is a complicated thing, when you have more time maybe increase the discussion with quick examples for two cases and more methods.
I just realized that you should explain what you mean by original form! You say corresponding values?
– Guto