So, when you say X = TESTING, I assume you mean a variable X = 'testing'
One thing you could do is copy the variable and then truncate it to the desired size you want.
From your example:
X = 'testing';
Y = 'world';
y1 = repmat(Y,1,2);
y1 = y1(1:length(X))
Do you know anything about X or Y? Like how long they'll be, at least relative to each other?