Expert Answer:
:
Method One Hard-coded replication of rows (twice in this example):
>> X = [0.0,0.82; 2.1,0.72; 4.2,0.68; 6.3,0.15];
>> D = mean(diff(X(:,1)));
>> Y(:,2) = [X(:,2);X(:,2)];
>> Y(:,1) = [X(:,1);X(:,1)+X(end,1)+D]
Y =
0 0.8200
2.1000 0.7200
4.2000 0.6800
6.3000 0.1500
8.4000 0.8200
10.5000 0.7200
12.6000 0.6800
14.7000 0.1500
Method Two Number of rows replicated by a constant (thrice in this example):
>> N = 3;
>> Z(:,2) = repmat(X(:,2),N,1);
>> Z(:,1) = linspace(0,D*(N*size(X,1)-1),size(Z,1))
Z =
0 0.8200
2.1000 0.7200
4.2000 0.6800
6.3000 0.1500
8.4000 0.8200
10.5000 0.7200
12.6000 0.6800
14.7000 0.1500
16.8000 0.8200
18.9000 0.7200
21.0000 0.6800
23.1000 0.1500